java.lang.NullPointerException

MuleSoft JIRA | Duncan Doyle | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When using the CXF as a webservice proxy (as described in this example: http://www.mulesource.org/display/MULE2USER/Proxying+Web+Services), Mule throws a NullPointerException when trying to write the response to the client. The configuration used is: <service name="JaxBService"> <inbound> <cxf:inbound-endpoint address="http://localhost:65082/services/JaxBService" wsdlLocation="classpath:jaxb.wsdl" proxy="true" serviceName="JaxBServiceService" namespace="http://mycompany.com/hr/schemas" synchronous="true"> </cxf:inbound-endpoint> </inbound> <outbound> <pass-through-router> <cxf:outbound-endpoint address="http://localhost:8080/JaxBService" proxy="true" synchronous="true" enableMuleSoapHeaders="true"> </cxf:outbound-endpoint> </pass-through-router> </outbound> </service> Notice that in this configuration I specify the WSDL in the <cfx:inbound-endpoint>. The outbound endpoint is a Spring-WebServices service on Apache Tomcat (which works correctly). The soap request is fired using SoapUI. The exceptions thrown by Mule is: ERROR 2009-03-30 22:41:56,071 [connector.http.0.receiver.2] org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy: null java.lang.NullPointerException at org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:266) at org.mule.transport.http.HttpServerConnection.writeResponse(HttpServerConnection.java:293) at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:619) The strange thing is that when I don't specify the WSDL on the <cfx:inbound-endpoint>, the exception is not thrown and the SOAP client (SoapUI in my case) receives the correct response. This configuration works correctly: <service name="JaxBService"> <inbound> <cxf:inbound-endpoint address="http://localhost:65082/services/JaxBService" proxy="true" synchronous="true"> </cxf:inbound-endpoint> </inbound> <outbound> <pass-through-router> <cxf:outbound-endpoint address="http://localhost:8080/JaxBService" proxy="true" synchronous="true" enableMuleSoapHeaders="true"> </cxf:outbound-endpoint> </pass-through-router> </outbound> </service>

    MuleSoft JIRA | 8 years ago | Duncan Doyle
    java.lang.NullPointerException
  2. 0

    When using the CXF as a webservice proxy (as described in this example: http://www.mulesource.org/display/MULE2USER/Proxying+Web+Services), Mule throws a NullPointerException when trying to write the response to the client. The configuration used is: <service name="JaxBService"> <inbound> <cxf:inbound-endpoint address="http://localhost:65082/services/JaxBService" wsdlLocation="classpath:jaxb.wsdl" proxy="true" serviceName="JaxBServiceService" namespace="http://mycompany.com/hr/schemas" synchronous="true"> </cxf:inbound-endpoint> </inbound> <outbound> <pass-through-router> <cxf:outbound-endpoint address="http://localhost:8080/JaxBService" proxy="true" synchronous="true" enableMuleSoapHeaders="true"> </cxf:outbound-endpoint> </pass-through-router> </outbound> </service> Notice that in this configuration I specify the WSDL in the <cfx:inbound-endpoint>. The outbound endpoint is a Spring-WebServices service on Apache Tomcat (which works correctly). The soap request is fired using SoapUI. The exceptions thrown by Mule is: ERROR 2009-03-30 22:41:56,071 [connector.http.0.receiver.2] org.mule.DefaultExceptionStrategy: Caught exception in Exception Strategy: null java.lang.NullPointerException at org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:266) at org.mule.transport.http.HttpServerConnection.writeResponse(HttpServerConnection.java:293) at org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190) at org.mule.work.WorkerContext.run(WorkerContext.java:310) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575) at java.lang.Thread.run(Thread.java:619) The strange thing is that when I don't specify the WSDL on the <cfx:inbound-endpoint>, the exception is not thrown and the SOAP client (SoapUI in my case) receives the correct response. This configuration works correctly: <service name="JaxBService"> <inbound> <cxf:inbound-endpoint address="http://localhost:65082/services/JaxBService" proxy="true" synchronous="true"> </cxf:inbound-endpoint> </inbound> <outbound> <pass-through-router> <cxf:outbound-endpoint address="http://localhost:8080/JaxBService" proxy="true" synchronous="true" enableMuleSoapHeaders="true"> </cxf:outbound-endpoint> </pass-through-router> </outbound> </service>

    MuleSoft JIRA | 8 years ago | Duncan Doyle
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Getting a nullpointer exception when switching displayables in J2ME

    Stack Overflow | 6 years ago | Pallinder
    java.lang.NullPointerException: 0 at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46 at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74 at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37 at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36 at com.sun.midp.chameleon.CWindow.keyInput(), bci=38 at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17 at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277 at com.sun.midp.events.EventQueue.run(), bci=179

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.mule.transport.cxf.CxfServiceComponent$1.write()
    2. org.mule.transport
      CxfServiceComponent$1.write
      1. org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:266)
      1 frame
    3. HTTP Transport
      HttpMessageReceiver$HttpWorker.run
      1. org.mule.transport.http.HttpServerConnection.writeResponse(HttpServerConnection.java:293)
      2. org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:190)
      2 frames
    4. Mule Core
      WorkerContext.run
      1. org.mule.work.WorkerContext.run(WorkerContext.java:310)
      1 frame
    5. Backport of JSR 166
      ThreadPoolExecutor$Worker.run
      1. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
      2. edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
      2 frames
    6. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:619)
      1 frame