java.lang.NullPointerException

MuleSoft JIRA | Duncan Doyle | 8 years ago
  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

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    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