ESB Mule 3.8.1 CE HTTP 请求抛出 doSelect 错误
ESB Mule 3.8.1 CE HTTP request thrown doSelect Error
我有 Anypoint 6.2.5
Mule 3.8.1 CE
当我试图发送 json 到 Magento2 Api.
我正在使用这样的 http 请求:
<http:request config-ref="HTTP_Request_Configuration" path="/products/attributes" method="POST" doc:name="HTTP">
<http:request-builder>
<http:header headerName="Authorization" value="Bearer xxxx"/>
<http:header headerName="Content-Type" value="application/json"/>
</http:request-builder>
</http:request>
响应超时设置为 10 秒
我收到一个错误:
cze 28, 2017 8:48:03 AM org.glassfish.grizzly.nio.SelectorRunner doSelect
SEVERE: 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)
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getThreadPoolFor(FlowWorkManagerIOStrategy.java:90)
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:69)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89)
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415)
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384)
at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348)
at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:748)
ERROR 2017-06-28 08:48:10,554 [[magento].readAttributeMessagesFromQueueFlow.stage1.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Error sending HTTP request.
Payload : {"attribute":{"is_visible":true,"attribute_code":"ts_size","frontend_input":"select","default_frontend_label":"ts_size","options":[{"label":"36","value":"36","sort_order":0,"is_default":true,"store_labels":[{"label":"36","store_id":0}]},{"label":"S","value":"S","sort_order":0,"is_default":true,"store_labels":[{"label":"S","store_id":0}]},{"label":"XS","value":"XS","sort_order":0,"is_default":true,"store_labels":[{"label":"XS","store_id":0}]},{"label":"XL","value":"XL","sort_order":0,"is_default":true,"store_labels":[{"label":"XL","store_id":0}]},{"label":"L","value":"L","sort_order":0,"is_default":true,"store_labels":[{"label":"L","store_id":0}]},{"label":"M","value":"M","sort_order":0,"is_default":true,"store_labels":[{"label":"M","store_id":0}]},{"label":"ONE SIZE","value":"ONE SIZE","sort_order":0,"is_default":true,"store_labels":[{"label":"ONE SIZE","store_id":0}]},{"label":"34","value":"34","sort_order":0,"is_default":true,"store_labels":[{"label":"34","store_id":0}]},{"label":"40","value":"40","sort_order":0,"is_default":true,"store_labels":[{"label":"40","store_id":0}]},{"label":"42","value":"42","sort_order":0,"is_default":true,"store_labels":[{"label":"42","store_id":0}]},{"label":"38","value":"38","sort_order":0,"is_default":true,"store_labels":[{"label":"38","store_id":0}]}],"frontend_labels":[{"label":"ts_size","store_id":0}]}}
Payload Type : [B
Element : /readAttributeMessagesFromQueueFlow/processors/2 @ magento:Attributes.xml:24 (HTTP)
Element XML : <http:request config-ref="HTTP_Request_Configuration" path="/products/attributes" method="POST" doc:name="HTTP">
<http:request-builder>
<http:header headerName="Authorization" value="Bearer 3vh5yv803usi8ik2ix695ukweu2j8nnq"></http:header>
<http:header headerName="Content-Type" value="application/json"></http:header>
</http:request-builder>
</http:request>
--------------------------------------------------------------------------------
Root Exception stack trace:
java.util.concurrent.TimeoutException: Timeout exceeded
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:433)
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.onTimeout(GrizzlyAsyncHttpProvider.java:281)
at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:401)
at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:380)
at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
我真的不知道该如何解决。
我确定发送请求有效 - Magento 中的新属性已正确创建,但显示错误且流程停止。
更多详细信息:
eclipse.buildId=unknown
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=pl_PL
Command-line arguments: -os linux -ws gtk -arch x86_64
它在我朋友的电脑上没有问题也没有错误。我的系统上是否缺少某些软件包?
bug 已经在 MULE-8989
https://www.mulesoft.org/jira/browse/MULE-8989 which is fixed in Mule runtime 3.8.2 https://docs.mulesoft.com/release-notes/mule-3.8.2-release-notes
提出
尝试升级我们的 mule runtime
更多参考:- https://forums.mulesoft.com/questions/58664/severe-doselect-exception.html
我解决了问题。
您需要从位于 /lib/user 文件夹的 CE 运行时删除名为 async-http-client 的 jar。
在 AnyPointStudio 安装中找到 CE Runtime。是这样的:
"../Eclipse/plugins/org.mule.tooling.server.3.8.1_6.0.0.201612271237/mule/lib/user"
找到并删除提到的jar文件,重启你的AnyPointStudio就可以了。
对于独立运行时,只需从 github 下载最新版本并使用 maven 构建它。
我有 Anypoint 6.2.5
Mule 3.8.1 CE
当我试图发送 json 到 Magento2 Api.
我正在使用这样的 http 请求:
<http:request config-ref="HTTP_Request_Configuration" path="/products/attributes" method="POST" doc:name="HTTP">
<http:request-builder>
<http:header headerName="Authorization" value="Bearer xxxx"/>
<http:header headerName="Content-Type" value="application/json"/>
</http:request-builder>
</http:request>
响应超时设置为 10 秒
我收到一个错误:
cze 28, 2017 8:48:03 AM org.glassfish.grizzly.nio.SelectorRunner doSelect
SEVERE: 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)
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getThreadPoolFor(FlowWorkManagerIOStrategy.java:90)
at org.mule.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:69)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89)
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415)
at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384)
at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348)
at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
at java.lang.Thread.run(Thread.java:748)
ERROR 2017-06-28 08:48:10,554 [[magento].readAttributeMessagesFromQueueFlow.stage1.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Error sending HTTP request.
Payload : {"attribute":{"is_visible":true,"attribute_code":"ts_size","frontend_input":"select","default_frontend_label":"ts_size","options":[{"label":"36","value":"36","sort_order":0,"is_default":true,"store_labels":[{"label":"36","store_id":0}]},{"label":"S","value":"S","sort_order":0,"is_default":true,"store_labels":[{"label":"S","store_id":0}]},{"label":"XS","value":"XS","sort_order":0,"is_default":true,"store_labels":[{"label":"XS","store_id":0}]},{"label":"XL","value":"XL","sort_order":0,"is_default":true,"store_labels":[{"label":"XL","store_id":0}]},{"label":"L","value":"L","sort_order":0,"is_default":true,"store_labels":[{"label":"L","store_id":0}]},{"label":"M","value":"M","sort_order":0,"is_default":true,"store_labels":[{"label":"M","store_id":0}]},{"label":"ONE SIZE","value":"ONE SIZE","sort_order":0,"is_default":true,"store_labels":[{"label":"ONE SIZE","store_id":0}]},{"label":"34","value":"34","sort_order":0,"is_default":true,"store_labels":[{"label":"34","store_id":0}]},{"label":"40","value":"40","sort_order":0,"is_default":true,"store_labels":[{"label":"40","store_id":0}]},{"label":"42","value":"42","sort_order":0,"is_default":true,"store_labels":[{"label":"42","store_id":0}]},{"label":"38","value":"38","sort_order":0,"is_default":true,"store_labels":[{"label":"38","store_id":0}]}],"frontend_labels":[{"label":"ts_size","store_id":0}]}}
Payload Type : [B
Element : /readAttributeMessagesFromQueueFlow/processors/2 @ magento:Attributes.xml:24 (HTTP)
Element XML : <http:request config-ref="HTTP_Request_Configuration" path="/products/attributes" method="POST" doc:name="HTTP">
<http:request-builder>
<http:header headerName="Authorization" value="Bearer 3vh5yv803usi8ik2ix695ukweu2j8nnq"></http:header>
<http:header headerName="Content-Type" value="application/json"></http:header>
</http:request-builder>
</http:request>
--------------------------------------------------------------------------------
Root Exception stack trace:
java.util.concurrent.TimeoutException: Timeout exceeded
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.timeout(GrizzlyAsyncHttpProvider.java:433)
at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider.onTimeout(GrizzlyAsyncHttpProvider.java:281)
at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:401)
at org.glassfish.grizzly.utils.IdleTimeoutFilter$DefaultWorker.doWork(IdleTimeoutFilter.java:380)
at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
我真的不知道该如何解决。
我确定发送请求有效 - Magento 中的新属性已正确创建,但显示错误且流程停止。
更多详细信息:
eclipse.buildId=unknown
java.version=1.8.0_131
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=pl_PL
Command-line arguments: -os linux -ws gtk -arch x86_64
它在我朋友的电脑上没有问题也没有错误。我的系统上是否缺少某些软件包?
bug 已经在 MULE-8989
https://www.mulesoft.org/jira/browse/MULE-8989 which is fixed in Mule runtime 3.8.2 https://docs.mulesoft.com/release-notes/mule-3.8.2-release-notes
提出
尝试升级我们的 mule runtime
更多参考:- https://forums.mulesoft.com/questions/58664/severe-doselect-exception.html
我解决了问题。
您需要从位于 /lib/user 文件夹的 CE 运行时删除名为 async-http-client 的 jar。
在 AnyPointStudio 安装中找到 CE Runtime。是这样的:
"../Eclipse/plugins/org.mule.tooling.server.3.8.1_6.0.0.201612271237/mule/lib/user"
找到并删除提到的jar文件,重启你的AnyPointStudio就可以了。
对于独立运行时,只需从 github 下载最新版本并使用 maven 构建它。