tina created AXIS2-5623:
---------------------------
Summary: axis2 NullPointerException when create stub in load test
Key: AXIS2-5623
URL: https://issues.apache.org/jira/browse/AXIS2-5623
Project: Axis2
Issue Type: Bug
Affects Versions: 1.5.4
Reporter: tina
We are using axis2-1.5.4 to generate stub client to send soap message, as we
known the axis2 is not thread-safe, so we use a pool to store stub instance.
Each thread will borrow stub object from the pool before use and return it to
pool after using. however, when the traffic is heavy(400 threads), there are
always some NPE exception, it seems although the instance is already returned
to the pool, it is still used by other thread. The exception stack is as below:
java.lang.NullPointerException: null
at
org.apache.axis2.client.ServiceClient.cleanupTransport(ServiceClient.java:824)
at
com.cmcc.aus.msgadpter.soap.security.SecurityClient.checkToken(SecurityClient.java:355)
at
com.cmcc.aus.service.esb.VerifyEaCallingTokenSvc.verifyEaCallingToken(VerifyEaCallingTokenSvc.java:81)
at
com.cmcc.aus.msgadpter.rest.VerifyEaCallingTokenRestInterface.postVerifyEaCallingToken(VerifyEaCallingTokenRestInterface.java:38)
And we also use cached http connection in the create of stub, the stub client
code is as below:
public SecurityStub(java.lang.String targetEndpoint) throws
org.apache.axis2.AxisFault {
this(null,targetEndpoint);
Options options = this._getServiceClient().getOptions();
options.setTimeOutInMilliSeconds(60000);
options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
Boolean.TRUE);
MultiThreadedHttpConnectionManager conmgr = new
MultiThreadedHttpConnectionManager();
conmgr.getParams().setDefaultMaxConnectionsPerHost(AusConstants.SECURITY_CLIENT_MAX_CONNECTION_NUM_PER_HOST);
conmgr.getParams().setMaxTotalConnections(AusConstants.SECURITY_CLIENT_MAX_CONNECTION_NUM);
HttpClient client = new HttpClient(conmgr);
options.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, client);
}
Can anyone help us why this happen? Thanks in advance!
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]