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.

  • 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>
    via by Duncan Doyle,
  • 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>
    via by Duncan Doyle,
    • 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)
    No Bugmate found.