找到了路由的异常:2。消息有效负载的类型为:Prediccion,在Mule上

时间:2015-04-08 17:50:32

标签: java mule

在Scatter-gater中,我在route2上有一个错误,它说

*******************************************************************************
Message               : Exception was found for route(s): 2. Message payload is of type: Prediccion
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Exception was found for route(s): 2. Message payload is of type: Prediccion (org.mule.routing.CompositeRoutingException)
  org.mule.routing.CollectAllAggregationStrategy:51 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/routing/CompositeRoutingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.routing.CompositeRoutingException: Exception was found for route(s): 2. Message payload is of type: Prediccion
    at org.mule.routing.CollectAllAggregationStrategy.aggregateWithFailedRoutes(CollectAllAggregationStrategy.java:51)
    at org.mule.routing.CollectAllAggregationStrategy.aggregate(CollectAllAggregationStrategy.java:38)
    at org.mule.routing.ScatterGatherRouter.processResponses(ScatterGatherRouter.java:210)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

Prediccion是返回在分散器的另一侧连接的自动变换器的类,我使用了很多变换器,但它不适用于任何变换器

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

<mule xmlns:twitter="http://www.mulesoft.org/schema/mule/twitter" xmlns:db="http://www.mulesoft.org/schema/mule/db" 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/db http://www.mulesoft.org/schema/mule/db/current/mule-db.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=1&amp;mode=json" doc:name="HTTP Request Configuration"/>
    <spring:beans>
        <spring:bean id="transformador" name="Bean" class="com.trabajosd.Transformador"/>
    </spring:beans>
    <db:mysql-config name="MySQL_Configuration" host="${db.host}" port="${db.port}" user="${db.user}" password="${db.password}" database="${db.database}" doc:name="MySQL Configuration"/>
    <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"/>
        <json:json-to-object-transformer doc:name="JSON to Object"/>
        <auto-transformer returnClass="com.trabajosd.Prediccion" name="JsonDataToPrediccion"></auto-transformer>
        <scatter-gather doc:name="Scatter-Gather">
            <processor-chain>
                <custom-filter class="com.trabajosd.Filtro" doc:name="Custom"/>
                <set-payload value="Predicci&#243;n de lluvia para hoy en  #[payload.getCiudad()]" doc:name="Set Payload"/>
                <smtp:outbound-endpoint host="${mail.host}" port="${mail.port}" user="${mail.user}" password="${mail.password}" connector-ref="gmail" to="${mail.to}" from="MULE" subject="Prediccion Meteorol&#243;gica" responseTimeout="10000" doc:name="Send notification email"/>
            </processor-chain>
            <db:insert config-ref="MySQL_Configuration" doc:name="Database">
                <db:dynamic-query><![CDATA[insert into valores(tiempo,pais,ciudad,humedad,presion,velocidad_viento) values ('#[payload.getTiempo()]','#[payload.getPais()]','#[payload.getCiudad()]','#[payload.getHumedad()]','#[payload.getPresion()]', '#[payload.getVelocidad_viento()]')]]></db:dynamic-query>
            </db:insert>
            <twitter:update-status config-ref="Twitter__Configuration" status="#[payload.toString()]" doc:name="Twitter"/>
        </scatter-gather>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <logger level="INFO" doc:name="Logger"/>
        </catch-exception-strategy>
    </flow>
    <catch-exception-strategy name="trabajosdCatch_Exception_Strategy">
    </catch-exception-strategy>
</mule>

0 个答案:

没有答案