Java Mule中的twitter云连接器需要输入

Java Mule中的twitter云连接器需要输入,java,twitter,mule,Java,Twitter,Mule,我有一个带有custon过滤器的流(带有回音),但是如果我尝试使用twitter云连接器,我会遇到这个错误 ERROR 2015-04-04 19:09:02,451 [[CopyTrabajosd2].trabajosdFlow.stage1.02] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: Response code 4

我有一个带有custon过滤器的流(带有回音),但是如果我尝试使用twitter云连接器,我会遇到这个错误

ERROR 2015-04-04 19:09:02,451 [[CopyTrabajosd2].trabajosdFlow.stage1.02] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: Work Descriptor. Root Exception was: Response code 403 mapped as failure. Message payload is of type: BufferInputStream. Type: class org.mule.module.http.internal.request.ResponseValidatorException
ERROR 2015-04-04 19:09:02,458 [[CopyTrabajosd2].trabajosdFlow.stage1.02] org.mule.exception.CatchMessagingExceptionStrategy: 
********************************************************************************
Message               : Response code 403 mapped as failure. Message payload is of type: BufferInputStream
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Response code 403 mapped as failure. Message payload is of type: BufferInputStream (org.mule.module.http.internal.request.ResponseValidatorException)
  org.mule.module.http.internal.request.SuccessStatusCodeValidator:37 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/module/http/internal/request/ResponseValidatorException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.module.http.internal.request.ResponseValidatorException: Response code 403 mapped as failure. Message payload is of type: BufferInputStream
    at org.mule.module.http.internal.request.SuccessStatusCodeValidator.validate(SuccessStatusCodeValidator.java:37)
    at org.mule.module.http.internal.request.DefaultHttpRequester.innerProcess(DefaultHttpRequester.java:202)
    at org.mule.module.http.internal.request.DefaultHttpRequester.process(DefaultHttpRequester.java:166)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
我认为clout连接器没有收到它需要的输入类型,但我不确定,是否有任何帮助

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
    xmlns:http="http://www.mulesoft.org/schema/mule/http" 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.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
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/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
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/twitter http://www.mulesoft.org/schema/mule/twitter/current/mule-twitter.xsd">
    <smtp:gmail-connector name="gmail" doc:name="Gmail"/>
    <http:request-config name="HTTP_Request_Configuration" host="api.openweathermap.org" port="80" basePath="data/2.5/forecast/daily?q=San Fernando,es&amp;lang=es&amp;units=metric&amp;cnt=2&amp;mode=json" doc:name="HTTP Request Configuration"/>
    <spring:beans>
        <spring:bean id="transformador" name="Bean" class="com.trabajosd.Transformador"/>
    </spring:beans>
    <twitter:config name="Twitter__Configuration" accessKey="3006010565-rUz6h4xnNoHO2juxGYQEK5jcM5DvSpxv7P3hv07" accessSecret="KxcqDQEo6JbHHR2S10lFN5luxXLEJauNhiBdZIeY7tUXO" consumerKey="LBxBQUYhbAFb5PeBtR7Jg4Evo" consumerSecret="AdD8lJYRS1OadJsn2BXhEbnhdcUNc1t3uM9pnOGH7eNfE2JxZu" doc:name="Twitter: Configuration"/>
    <flow name="trabajosdFlow">
        <poll doc:name="Poll">
            <fixed-frequency-scheduler frequency="10000"/>
            <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
        </poll>
        <logger level="INFO" doc:name="Logger"/>
        <byte-array-to-string-transformer doc:name="Byte Array to String"/>
        <json:json-to-object-transformer doc:name="JSON to Object"/>
        <custom-filter class="com.trabajosd.Filtro" doc:name="Custom"/>
        <twitter:update-status config-ref="Twitter__Configuration" status="Predicci&#243;n de lluvia para hoy(Prueba Mule)" doc:name="Twitter"/>
        <catch-exception-strategy doc:name="Catch Exception Strategy"/>
    </flow>
    <catch-exception-strategy name="trabajosdCatch_Exception_Strategy">
        <logger level="INFO" doc:name="Logger"/>
    </catch-exception-strategy>
</mule>

Mule 3.6.x中的WWW authenticate标头似乎存在问题

错误通常是“收到401响应,但不存在WWW验证标头”。不确定在您的案例中为什么是http响应403

我尝试了一个基本的推特流,它可以在Mule 3.5上运行,但不能在3.6上运行

报告的问题是:

package com.trabajosd;

import org.json.JSONArray;
import org.json.JSONObject;
import org.mule.api.MuleMessage;
import org.mule.api.routing.filter.Filter;

public class Filtro implements Filter{

    @Override
    public boolean accept(MuleMessage message) {
        try {
            String json=message.getPayloadAsString();
            JSONObject obj = new JSONObject(json);
            JSONArray lista = obj.getJSONArray("list");
            JSONObject elemento0 =lista.getJSONObject(0);
            JSONArray clima = elemento0.getJSONArray("weather");
            JSONObject prediccion = clima.getJSONObject(0);

            return prediccion.getString("main").equalsIgnoreCase("Clouds");

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return false;
    }

}