gpt4 book ai didi

java - JBOSS类加载问题

转载 作者:行者123 更新时间:2023-12-01 05:02:07 25 4
gpt4 key购买 nike

当我将某些 jar 集放入 JBoss 配置文件的/lib 中时,我的应用程序能够使用 http 客户端(commons-httpclient-3.1)连接到后端服务器,但是当我放入相同的 jar 集时在应用程序库(web-inf/lib)中,应用程序将抛出空指针异常。要求是将这些 jar 放在 Web-Inf/lib 中。这组 jar 是:

  1. axiom-api-1.2.7.jar
  2. axiom-impl-1.2.7.jar
  3. axis2-kernel-1.4.1.jar
  4. bcmail-jdk14-130.jar
  5. bcprov-jdk14-130.jar
  6. bctsp-jdk14-130.jar
  7. 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)

请帮助我们如何解决此问题。问候,

最佳答案

我不确定这是否是您遇到的唯一问题,但可以肯定库 bcprov-jdk14-130.jarbctsp-jdk14-130.jar > 不适用于 java 1.4。您需要使用java 1.5兼容版本;在此处查看下载:http://www.bouncycastle.org/latest_releases.html .

NPE 被抛出在来自 httpclient 的代码上。 、广告

socket.setTcpNoDelay(this.params.getTcpNoDelay());

我认为问题是套接字为空(这可能是使用错误版本的充气城堡的结果)。据我所知,但我可能是错的,http客户端确保在HttpConnectionParams中设置所有必需的参数,所以我不认为this.params.getTcpNoDelay()抛出NPE。

在这种情况下,我建议您将 IDE 设置为进行远程调试。我相信您会发现它非常有用。

关于java - JBOSS类加载问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13251316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com