我有Anypoint 6.2.5
骡子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$3.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
它的工作没有问题,没有错误的朋友Pc。我错过了系统上的一些软件包吗?
答案 0 :(得分:2)
我解决了问题。
您需要从位于/ lib / user文件夹的CE Runtime中删除名为async-http-client的jar。
在AnyPointStudio安装中,找到CE Runtime。它是这样的:
&#34; ../的Eclipse /插件/ org.mule.tooling.server.3.8.1_6.0.0.201612271237 /骡/ LIB /用户&#34;
找到并删除上面提到的jar文件,重新启动AnyPointStudio并且没问题。
对于Standalone Runtime,只需从github下载最新版本并使用maven构建它。
答案 1 :(得分:1)
在https://www.mulesoft.org/jira/browse/MULE-8989处已经提出了{strong>错误,MULE-8989
已在Mule运行时3.8.2 https://docs.mulesoft.com/release-notes/mule-3.8.2-release-notes中修复了
尝试升级我们的mule运行时
更多参考: - https://forums.mulesoft.com/questions/58664/severe-doselect-exception.html