我有一个Mule流尝试使HTTP请求发出。Mule在从JBoss发出http请求时给出错误
<http:request config-ref="APP_OUT" path="#[message.inboundProperties.'http.request.path']" method="#[message.inboundProperties.'http.method']" doc:name="OUT" sendBodyMode="ALWAYS" parseResponse="false" followRedirects="false">
<http:request-builder>
<http:header headerName="HOST" value="#[message.inboundProperties.'host']"/>
</http:request-builder>
</http:request>
这从Mule工作室以及作为独立的Java应用程序运行Mule时可以使用。但是,当我将它作为webapp使用到JBoss7时,我立即得到错误。我们可以排除我几秒钟后遇到的超时错误。
16:56:27,393 SEVERE [org.glassfish.grizzly.nio.SelectorRunner] ([myapp].http.requester.APP_OUT(1) SelectorRunner) doSelect exception: java.lang.IllegalAccessError: tried to access method com.ning.http.client.providers.grizzly.HttpTransactionContext.getAsyncHandler()Lcom/ning/http/client/AsyncHandler; from class org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getWorkManager(FlowWorkManagerIOStrategy.java:119) [mule-module-http-3.7.2.jar:3.7.2]
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getThreadPoolFor(FlowWorkManagerIOStrategy.java:90) [mule-module-http-3.7.2.jar:3.7.2]
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:69) [mule-module-http-3.7.2.jar:3.7.2]
at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:278) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) [grizzly-framework-2.3.21.jar:2.3.21]
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) [grizzly-framework-2.3.21.jar:2.3.21]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
有谁知道这是不是已知的问题?我能看到别人张贴同样的问题上MuleSoft论坛,没有任何反应
http://forums.mulesoft.com/questions/30322/mule-372-issue-when-using-httprequest-and-running-1.html
JBoss7不包含'HttpTransactionContext'类。然而我的项目在两个地方有这个1)async-http-client-1.9.27.jar和2)mule-module-http-3.7.2.jar。两个类都在完全相同的包中。如果我尝试从我的项目中排除async-http-client,那么我会得到'java.lang.ClassNotFoundException:com.ning.http.client.AsyncHandler'异常。我不明白为什么Mule JAR包含来自其他公共库的类,同时Maven依赖于同一个库。 – user1431708
@ user1431708我已经编辑了我的答案。我建议你报告这个错误https://www.mulesoft.org/jira/browse/MULE,并在这里分享JIRA ID,以便我们可以对它进行调整/跟踪。 –
通过将HttpTransactionContext.java的源代码从mule-module-http复制到我的src/main/java中进行本地修复,该代码优先于WEB-INF/lib目录的内容。 这个问题已经报告给Mulesoft [Mule-89989](https://www.mulesoft.org/jira/browse/MULE-8989) – user1431708