Note that there are some explanatory texts on larger screens.

plurals
  1. POAxis2 generated Stubs are thread-safe?
    primarykey
    data
    text
    <p>Are the Stubs generated by WSDL2JAVA (using XMLBeans binding option) through Axis2 1.5.4 thread-safe? </p> <p>Actually I have created one Stub for a Web Service that I am invoking through multiple threads. I have configured my own <code>MultiThreadedHttpConnectionmanager</code> and set the <code>HTTPConstants.REUSE_HTTP_CLIENT</code> as well but I am seeing some NullPointerExceptions in <code>stub._getServiceClient().cleanupTransport</code> that I call after each invocation. </p> <p>Sometimes the threads hang too. </p> <p>At the same time I noticed that in the generated Stub in the Web Service operation method, cleanup() is called already in the finally block. Should I not call <code>stub._getServiceClient().cleanupTransport</code> myself afterwards?</p> <p>My code:</p> <pre><code> httpConnMgr = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams params = httpConnMgr.getParams(); if (params == null) { params = new HttpConnectionManagerParams(); } params.setDefaultMaxConnectionsPerHost(numberOfThreads); httpConnMgr.setParams(params); HttpClient httpClient = new HttpClient(httpConnMgr); service = new Service1Stub(this.endPointAddress); service._getServiceClient().getOptions() .setTimeOutInMilliSeconds(this.timeOut); service._getServiceClient().getOptions() .setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE); service._getServiceClient().getOptions() .setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.FALSE); service._getServiceClient() .getOptions() .setProperty(HTTPConstants.SO_TIMEOUT, (int) (this.timeOut)); service._getServiceClient() .getOptions() .setProperty(HTTPConstants.CONNECTION_TIMEOUT, (int) (this.timeOut)); service._getServiceClient().getServiceContext().getConfigurationContext() .setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient); </code></pre> <p>Meanwhile in the generated stub, I noticed that cleanUp is already been called:</p> <pre><code> finally { _messageContext.getTransportOut().getSender().cleanup(_messageContext); } </code></pre> <p>Any suggestion would be greatly helpful. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload