Erro in XPATH with Choise Component

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Erro in XPATH with Choise Component

dpachacomartins
This post has NOT been accepted by the mailing list yet.
Hi all.

I'm trying to use a little example of the "Choise Component" with a XPaxh Expression, however the Mule is return a error, like below:

[08-22 10:28:12] ERROR DefaultMessagingExceptionStrategy [[hellowordtest].HelloWordFlow1.stage1.02]: Caught exception in Exception Strategy: Failed to evaluate XPath expression: "/embarque/codigo = 'a'"
org.mule.api.MuleRuntimeException: Failed to evaluate XPath expression: "/embarque/codigo = 'a'"
        at org.mule.module.xml.expression.AbstractXPathExpressionEvaluator.evaluate(AbstractXPathExpressionEvaluator.java:144)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:273)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:209)
        at org.mule.expression.DefaultExpressionManager.evaluateBoolean(DefaultExpressionManager.java:321)
        at org.mule.routing.filters.ExpressionFilter.accept(ExpressionFilter.java:125)
        at org.mule.routing.ChoiceRouter.selectProcessors(ChoiceRouter.java:35)
        at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:194)
        at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:99)
        at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:66)
        at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:105)
        at org.mule.interceptor.AbstractEnvelopeInterceptor.process(AbstractEnvelopeInterceptor.java:55)
        at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:111)
        at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:158)
        at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:43)
        at org.mule.work.WorkerContext.run(WorkerContext.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: XML DOM type "class [B" is currently not supported
        at org.mule.module.xml.expression.XPathExpressionEvaluator.createXPath(XPathExpressionEvaluator.java:50)
        at org.mule.module.xml.expression.AbstractXPathExpressionEvaluator.getXPath(AbstractXPathExpressionEvaluator.java:180)
        at org.mule.module.xml.expression.AbstractXPathExpressionEvaluator.evaluate(AbstractXPathExpressionEvaluator.java:122)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:273)
        at org.mule.expression.DefaultExpressionManager.evaluate(DefaultExpressionManager.java:209)
        at org.mule.expression.DefaultExpressionManager.evaluateBoolean(DefaultExpressionManager.java:321)
        at org.mule.routing.filters.ExpressionFilter.accept(ExpressionFilter.java:125)
        at org.mule.routing.ChoiceRouter.selectProcessors(ChoiceRouter.java:35)
        at org.mule.routing.AbstractSelectiveRouter.process(AbstractSelectiveRouter.java:194)
        ... 8 more


Follow below my XML:

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

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd ">
    <wildcard-filter pattern="/services/echo/" caseSensitive="true" name="Wildcard" doc:name="Wildcard"/>
    <http:http-response-to-object-transformer returnClass="br.com.danilo.Name" name="HTTP_Response_to_Object" doc:name="HTTP Response to Object"/>
    <http:endpoint exchange-pattern="request-response" name="HTTP" address="http://localhost:8889/poster" doc:name="HTTP"/>
    <flow name="HelloWordFlow1" doc:name="HelloWordFlow1">
        <http:inbound-endpoint exchange-pattern="one-way" ref="HTTP" doc:name="HTTP"/>
        <choice doc:name="Choice">
            <when expression="/embarque/codigo = 'a'" evaluator="xpath">
                <processor-chain>
                    <file:outbound-endpoint path="D:\temp\out1" outputPattern="teste1.xml" doc:name="File"/>
                </processor-chain>
            </when>
            <otherwise>
                <processor-chain>
                    <file:outbound-endpoint path="D:\temp\out2" outputPattern="teste2.xml" doc:name="File"/>
                </processor-chain>
            </otherwise>
        </choice>
    </flow>
</mule>

My XPATH Expression is correct... do you know what the reason for this error?

Danilo Pacheco Martins.