当我将某些 jar 集放入 JBoss 配置文件的 /lib 中时,我的应用程序能够使用 http 客户端(commons-httpclient-3.1)连接到后端服务器,但是当我将同一组 jar 放入应用程序中时library(web-inf/lib) 然后应用程序抛出空指针异常。要求是将这些罐子放在 Web-Inf/lib 中。罐子集是:
- axiom-api-1.2.7.jar
- axiom-impl-1.2.7.jar
- axis2-kernel-1.4.1.jar
- bcmail-jdk14-130.jar
- bcprov-jdk14-130.jar
- bctsp-jdk14-130.jar
- commons-httpclient-3.1.jar
失败场景的堆栈跟踪如下:
Caused by: java.lang.NullPointerException
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:721)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
请帮助我们如何解决这个问题。问候,