Hi,
I have a simple program to test invoking a web service with multi threads.
Myteriously I got NullpointerException when I start the testprogramm at the
first time. Next time, when I start the testprogramm again, it works fine.
The error points to the create method of JaxWsProxyFactoryBean.

Do you have any idea, why does it run into errors at the first time? 

Best Regards,

Ming

================
This is my client implementation
================
public SessionWebServiceClientImpl() throws
WebServiceClientInstantiationException {
/* Instantiate the service */

this.clientProxyFactory = new JaxWsProxyFactoryBean();
this.serviceURL =
CXFWebServiceClientProxy.this.databaseReference.getSessionServiceURL().toString();
this.clientProxyFactory.setServiceClass(SessionWebService.class);
this.clientProxyFactory.setAddress(this.serviceURL);
this.serviceClient = (SessionWebService) this.clientProxyFactory.create();
=> Line 161 Client client =
this.clientProxyFactory.getClientFactoryBean().getClient();
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy clientPolicy = new HTTPClientPolicy();
clientPolicy.setReceiveTimeout(2 * 60 * 1000);
conduit.setClient(clientPolicy);
}

================
This is the log
================
Exception in thread "Thread-39" java.lang.NullPointerException
        at
org.apache.cxf.binding.soap.SoapBindingFactory.createSoapBinding(SoapBindingFactory.java:182)
        at
org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(SoapBindingFactory.java:171)
        at
org.apache.cxf.binding.AbstractBindingFactory.createBindingInfo(AbstractBindingFactory.java:82)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:383)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:258)
        at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:146)
        at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
        at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
        at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
        at
de.destatis.idb.web.ws.client.cxf.CXFWebServiceClientProxy$SessionWebServiceClientImpl.<init>(CXFWebServiceClientProxy.java:161)
        at
de.destatis.idb.web.ws.client.cxf.CXFWebServiceClientProxy.getSessionWebServiceClient(CXFWebServiceClientProxy.java:83)
        at de.destatis.idb.test.TestMultiThread.run(TestMultiThread.java:43)
.................... 
-- 
View this message in context: 
http://www.nabble.com/NPE-by-getting-client-tp21461796p21461796.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to