java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • JBOSS Classloading issue
    via Stack Overflow by Harshit
    ,
  • The HttpClient throws NullPointerException in the main thread when an invalid port (like 80001) is used in the URL. An IllegalArgumentException is thrown in TimeoutGuard thread. Exception in thread "Timeout guard" java.lang.IllegalArgumentException: port out of range:80001 at java.net.InetSocketAddress.<init>(InetSocketAddress.java:118) at java.net.Socket.<init>(Socket.java:240) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80) at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1.doit(ControllerThreadSocketFactory.java:91) at org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$SocketTask.run(ControllerThreadSocketFactory.java:158) at java.lang.Thread.run(Thread.java:613) Exception in thread "main" java.lang.NullPointerException at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721) at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at com.aol.test.HttpTest$PoolingHttpConnector.doGet(HttpTest.java:47) at com.aol.test.HttpTest.main(HttpTest.java:17) It should throw a checked exception in main thread so caller can handle the error condition more gracefully. The test program is attached. This is caused by a race condition and it's not always reproducible. Running in debugger shows a different behavior. package com.aol.test; import java.io.IOException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.httpclient.params.HttpConnectionManagerParams; public class HttpTest { public static void main(String[] args) { PoolingHttpConnector conn = new PoolingHttpConnector(); try { String response = conn.doGet("http://www.aol.com:80001"); System.out.println("Response='" + response + "'"); } catch (IOException e) { e.printStackTrace(); } } static class PoolingHttpConnector { public static final int MAX_TOTAL_CONNECTIONS = 16; public static final int MAX_CONNECTIONS_PER_HOST = 8; public static final int CONNECT_TIMEOUT = 5000; public static final int SOCKET_TIMEOUT = 5000; public static final boolean TCP_NO_DELAY = true; private static MultiThreadedHttpConnectionManager poolManager; private static HttpConnectionManagerParams httpParams; private static HttpClient httpClient; private static boolean initialized = false; public PoolingHttpConnector() { initialize(); } public String doGet(String url) throws IOException { GetMethod method = new GetMethod(url); try { int status = httpClient.executeMethod(method); String response = new String(method.getResponseBody()); if (status != HttpStatus.SC_OK) throw new IOException("HTTP error: " + response); return response; } finally { method.releaseConnection(); } } private synchronized void initialize() { if (initialized) return; poolManager = new MultiThreadedHttpConnectionManager(); httpParams = new HttpConnectionManagerParams(); httpParams.setMaxTotalConnections(MAX_TOTAL_CONNECTIONS); httpParams.setDefaultMaxConnectionsPerHost(MAX_CONNECTIONS_PER_HOST); httpParams.setTcpNoDelay(TCP_NO_DELAY); httpParams.setSoTimeout(SOCKET_TIMEOUT); httpParams.setConnectionTimeout(CONNECT_TIMEOUT); poolManager.setParams(httpParams); httpClient = new HttpClient(poolManager); initialized = true; } } }
    via by Zhihong Zhang,
  • Create an analyzer report from a model. save it as a sample with special characters. eg. saíóúüñ The save happens well. Click the publish icon to publish. Notice the following error in spoon console. ERROR 23-04 12:17:01,062 - org.dom4j.DocumentException: C:\prd\ßΘφ≤- ⁿ±┐ísample.xanalyzer (The system cannot find the file specified) Nested exception: C:\prd\ßΘφ≤- ⁿ±┐ísample.xanalyzer (The system cannot find the file specified) org.pentaho.platform.dataaccess.datasource.beans.Connection if u dont notice this error in the console, but you go ahead and complete the publish dialog, and click OK you get the following error in the console. ERROR 23-04 12:18:41,437 - java.io.FileNotFoundException: File is not a normal file. at org.apache.commons.httpclient.methods.multipart.FilePartSource.<init>(FilePartSource.java:68) at org.apache.commons.httpclient.methods.multipart.FilePart.<init>(FilePart.java:126) at org.pentaho.platform.util.client.PublisherUtil.publish(PublisherUtil.java:127) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishFile(ModelServerPublish.java:210) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishToServer(ModelServerPublish.java:394) at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:70) at org.pentaho.agilebi.pdi.visualizations.analyzer.AnalyzerVisualizationController.publish(AnalyzerVisualizationController.java:374) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:323) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:119) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton.access$100(SwtToolbarbutton.java:35) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton$1.widgetSelected(SwtToolbarbutton.java:82) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1143) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6538) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:541) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:110) ERROR 23-04 12:18:41,437 - An exception occurred while getting the length of the parts java.lang.NullPointerException at org.apache.commons.httpclient.methods.multipart.Part.getLengthOfParts(Part.java:424) at org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity.getContentLength(MultipartRequestEntity.java:171) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.getRequestContentLength(EntityEnclosingMethod.java:332) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.addContentLengthRequestHeader(EntityEnclosingMethod.java:402) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.addRequestHeaders(EntityEnclosingMethod.java:370) at org.apache.commons.httpclient.HttpMethodBase.writeRequestHeaders(HttpMethodBase.java:2036) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1919) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at org.pentaho.platform.util.client.PublisherUtil.publish(PublisherUtil.java:143) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishFile(ModelServerPublish.java:210) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishToServer(ModelServerPublish.java:394) at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:70) at org.pentaho.agilebi.pdi.visualizations.analyzer.AnalyzerVisualizationController.publish(AnalyzerVisualizationController.java:374) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:323) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:119) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton.access$100(SwtToolbarbutton.java:35) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton$1.widgetSelected(SwtToolbarbutton.java:82) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1143) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6538) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:541) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:110) ERROR 23-04 12:18:41,578 - An exception occurred while getting the length of the parts java.lang.NullPointerException at org.apache.commons.httpclient.methods.multipart.Part.getLengthOfParts(Part.java:424) at org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity.getContentLength(MultipartRequestEntity.java:171) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.getRequestContentLength(EntityEnclosingMethod.java:332) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:480) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at org.pentaho.platform.util.client.PublisherUtil.publish(PublisherUtil.java:143) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishFile(ModelServerPublish.java:210) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishToServer(ModelServerPublish.java:394) at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:70) at org.pentaho.agilebi.pdi.visualizations.analyzer.AnalyzerVisualizationController.publish(AnalyzerVisualizationController.java:374) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:323) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:119) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton.access$100(SwtToolbarbutton.java:35) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton$1.widgetSelected(SwtToolbarbutton.java:82) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1143) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6538) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:541) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:110) ERROR 23-04 12:18:41,718 - Error invoking method: analyzerVis.publish() java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:323) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:119) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton.access$100(SwtToolbarbutton.java:35) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton$1.widgetSelected(SwtToolbarbutton.java:82) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1143) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6538) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:541) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:110) Caused by: org.pentaho.agilebi.pdi.modeler.ModelerException: java.lang.NullPointerException at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:80) at org.pentaho.agilebi.pdi.visualizations.analyzer.AnalyzerVisualizationController.publish(AnalyzerVisualizationController.java:374) ... 22 more Caused by: java.lang.NullPointerException at org.apache.commons.httpclient.methods.multipart.Part.sendParts(Part.java:383) at org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity.writeRequest(MultipartRequestEntity.java:163) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at org.pentaho.platform.util.client.PublisherUtil.publish(PublisherUtil.java:143) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishFile(ModelServerPublish.java:210) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishToServer(ModelServerPublish.java:394) at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:70) ... 23 more ERROR 23-04 12:18:41,875 - Error calling oncommand event org.pentaho.ui.xul.XulException: Error invoking method: analyzerVis.publish() at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:327) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:131) at org.pentaho.ui.xul.impl.AbstractXulComponent.invoke(AbstractXulComponent.java:119) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton.access$100(SwtToolbarbutton.java:35) at org.pentaho.ui.xul.swt.tags.SwtToolbarbutton$1.widgetSelected(SwtToolbarbutton.java:82) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1143) at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:6538) at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:541) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.commons.launcher.Launcher.main(Launcher.java:110) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.pentaho.ui.xul.impl.AbstractXulDomContainer.invoke(AbstractXulDomContainer.java:323) ... 17 more Caused by: org.pentaho.agilebi.pdi.modeler.ModelerException: java.lang.NullPointerException at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:80) at org.pentaho.agilebi.pdi.visualizations.analyzer.AnalyzerVisualizationController.publish(AnalyzerVisualizationController.java:374) ... 22 more Caused by: java.lang.NullPointerException at org.apache.commons.httpclient.methods.multipart.Part.sendParts(Part.java:383) at org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity.writeRequest(MultipartRequestEntity.java:163) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at org.pentaho.platform.util.client.PublisherUtil.publish(PublisherUtil.java:143) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishFile(ModelServerPublish.java:210) at org.pentaho.agilebi.pdi.modeler.ModelServerPublish.publishToServer(ModelServerPublish.java:394) at org.pentaho.agilebi.pdi.perspective.PublisherHelper.publish(PublisherHelper.java:70) ... 23 more
    via by Golda David,
    • java.lang.NullPointerException at org.apache.commons.httpclient.auth.NTLM.hashPassword(NTLM.java:432) at org.apache.commons.httpclient.auth.NTLM.getType3Message(NTLM.java:418) at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:345) at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320) at org.apache.commons.httpclient.HttpMethodDirector.authenticate(HttpMethodDirector.java:232) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.executeMethod(CommonsHttpClientRemoteStorage.java:363) at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.CommonsHttpClientRemoteStorage.retrieveItem(CommonsHttpClientRemoteStorage.java:136)
    No Bugmate found.