我使用axis2 1.5.4生成存根客户端来发送soap消息,因为我知道axis2不是线程安全的,所以我使用池来存储存根实例。每个线程都会在使用前从池中借用存根对象,并在使用后将其返回到池中。然而,当流量很大(400个线程)时,总是会有一些NPE异常,似乎虽然实例已经返回到池中,但它仍然被其他线程使用。异常堆栈跟踪如下:
java.lang.NullPointerException: null
at org.apache.axis2.client.ServiceClient.cleanupTransport(ServiceClient.java:824)
at
我得到以下错误: <B>
Description: Unable to locate the server named "
<em>localhost</em>" --- the server does not have a DNS entry. Perhaps there is a misspelling in the server name, or the server no longer exists. Double-check the name and try again.
</B>