我正在关注本教程https://www.mulesoft.com/exchange#!/twitter-integration-connector,当我尝试使用updateStatus发送推文时,我收到此消息无法调用updateStatus。消息有效内容的类型为:NullPayload,show user action有效,但不是updateStatus
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/twitter http://www.mulesoft.org/schema/mule/twitter/current/mule-twitter.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
<twitter:config name="Twitter" accessKey="${twitter.accessKey}" accessSecret="${twitter.accessSecret}" consumerKey="${twitter.consumerKey}" consumerSecret="${twitter.consumerSecret}" streamBaseUrl="https://stream.twitter.com/1.1/" siteStreamBaseUrl="https://sitestream.twitter.com/1.1/" doc:name="Twitter"/>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" basePath="updateStatus" doc:name="HTTP Listener Configuration"/>
<flow name="twitterFlow1">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<twitter:update-status config-ref="Twitter" status="Mensaje" doc:name="Twitter"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
</flow>
</mule>
这是堆栈跟踪
Exception stack is:
1. 401 response received, but no WWW-Authenticate header was present (java.lang.IllegalStateException)
com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter$AuthorizationHandler:1623 (null)
2. java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.util.concurrent.ExecutionException)
org.glassfish.grizzly.impl.SafeFutureImpl$Sync:363 (null)
3. java.util.concurrent.ExecutionException: java.lang.IllegalStateException: 401 response received, but no WWW-Authenticate header was present (java.io.IOException)
org.mule.module.http.internal.request.grizzly.GrizzlyHttpClient:282 (null)
4. Error sending HTTP request. Message payload is of type: MuleHttpClient$1 (org.mule.api.MessagingException)
org.mule.module.http.internal.request.DefaultHttpRequester:190 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
Twitter应用程序具有读取,写入和直接消息许可,但我不确定应用程序网站字段。
答案 0 :(得分:1)
似乎Mule 3.6.x中的WWW-authenticate标头标题存在问题。
我尝试了一个基本的Twitter流程,它适用于Mule 3.5但不适用于3.6。
报告的问题是:
答案 1 :(得分:0)
我正在遵循相同的教程并遇到了同样的问题。我需要使用新版本4连接器更新默认的twitter连接器。然后代码工作,但它只能工作一次。为了让它再次工作,我似乎需要更改状态消息并重新运行 - 否则我再次获得null有效负载消息。只是停止并启动应用程序似乎不够好 - 我似乎需要更改状态。