我有一個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