Hello,

Could you please take a look at the camel context and log output below - why
does onException block use "customerpaymentstatusreportv03.SharedRoute"
logger name when printing error message? The error has occurred in
"customerpaymentstatusreportv03.MainRouteEE" route's setProperty clause (in
Xpath), because otherwise the following line
<log message="Exchange[Id:${exchangeId}];${property.REQUEST_ID}"
loggingLevel="INFO" />
would be printed to the log.

Igor

=============================

2011-12-08 11:46:02,332 | DEBUG | customerpaymentstatusreportv03.MainRouteEE
| Exchange[Id:ID:51756575655a656584d2b02ac5af29d0b18984e6e1d944b5,
ExchangePattern:InOnly, BodyType:byte[]]
2011-12-08 11:46:02,354 | ERROR |
*customerpaymentstatusreportv03.SharedRoute* |
Exchange[Id:ID:51756575655a656584d2b02ac5af29d0b18984e6e1d944b5];;Error has
occurred: [B cannot be cast to org.w3c.dom.Node. Stacktrace:
java.lang.ClassCastException: [B cannot be cast to org.w3c.dom.Node
        at
org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:121)
        at
org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:99)
        at
org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:184)
        at
org.apache.camel.builder.xml.XPathBuilder.doInEvaluateAs(XPathBuilder.java:667)
        at
org.apache.camel.builder.xml.XPathBuilder.evaluateAs(XPathBuilder.java:639)
        at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:612)
        at
org.apache.camel.builder.xml.XPathBuilder.evaluate(XPathBuilder.java:138)
        at
org.apache.camel.builder.ProcessorBuilder$7.process(ProcessorBuilder.java:148)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:106)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:63)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

=============================

        <camel-osgi:camelContext id="customerPaymentStatusReportV03"
xmlns="http://camel.apache.org/schema/spring";
                        
xmlns:urn="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03">

                <properties>
                        <property key="CamelLogDebugBodyMaxChars" value="1"/>
                        <property key="CamelLogDebugStreams" value="false"/>
                </properties>   
                        
                <propertyPlaceholder id="properties" location="file:..."/>
        
        <endpoint id="queue_lv" uri="ibmmq:..." />
        <endpoint id="queue_ee" uri="ibmmq:..." />
        <endpoint id="queue_esb" uri="ibmmq:..."/>
        <endpoint id="call_esb_service" uri="direct:call_esb_service" />

        *<onException>*
            <exception>java.lang.Exception</exception>
            <handled><constant>false</constant></handled> 
            <log
message="Exchange[Id:${exchangeId}];${property.REQUEST_ID};Error has
occurred: ${exception.message}. Stacktrace: ${exception.stacktrace}"
loggingLevel="ERROR" />
       * </onException>*
                
                         
            *<route id="customerpaymentstatusreportv03.MainRouteLV">*
                <from ref="queue_lv"/>
                        <transacted ref="PROPAGATION_REQUIRED" />
                <setExchangePattern pattern="InOnly" />
                        
                <to
uri="log:customerpaymentstatusreportv03.MainRouteLV?showProperties=false&amp;showExchangeId=true&amp;showHeaders=false&amp;showBody=false&amp;level=DEBUG"/>
                        <setProperty propertyName="REQUEST_ID">
                                <xpath
resultType="java.lang.String">concat(//urn:CstmrPmtStsRpt/urn:GrpHdr/urn:MsgId,
",", //urn:CstmrPmtStsRpt/urn:OrgnlGrpInfAndSts/urn:OrgnlMsgId)</xpath>   
                        </setProperty>
                        <log 
message="Exchange[Id:${exchangeId}];${property.REQUEST_ID}"
loggingLevel="INFO" />
                        
                <to ref="call_esb_service" />
                        <log 
message="Exchange[Id:${exchangeId}];${property.REQUEST_ID};Service
successfully executed." loggingLevel="DEBUG" />
        </route>

                                
            *<route id="customerpaymentstatusreportv03.MainRouteEE">*
                <from ref="queue_ee" />
                        <transacted ref="PROPAGATION_REQUIRED" />
                <setExchangePattern pattern="InOnly" />
                        
                <to
uri="log:customerpaymentstatusreportv03.MainRouteEE?showProperties=false&amp;showExchangeId=true&amp;showHeaders=false&amp;showBody=false&amp;level=DEBUG"/>
                        *<setProperty propertyName="REQUEST_ID">*
                                <xpath
resultType="java.lang.String">concat(//urn:CstmrPmtStsRpt/urn:GrpHdr/urn:MsgId,
",", //urn:CstmrPmtStsRpt/urn:OrgnlGrpInfAndSts/urn:OrgnlMsgId)</xpath>
                        *</setProperty>*
                        <log 
message="Exchange[Id:${exchangeId}];${property.REQUEST_ID}"
loggingLevel="INFO" />
                        
                <to ref="call_esb_service" />
                        <log 
message="Exchange[Id:${exchangeId}];${property.REQUEST_ID};Service
successfully executed." loggingLevel="DEBUG" />
                </route>

                                
                *<route id="customerpaymentstatusreportv03.SharedRoute">*
                <from ref="call_esb_service" />
                <transacted ref="PROPAGATION_REQUIRED" />
                        
                <setExchangePattern pattern="InOnly" />
                <setHeader headerName="ESBHeader_ServiceName">
                        <constant>PaymentsInitiationCallback</constant>
                </setHeader>
                <setHeader headerName="ESBHeader_ServiceOperation">
                        <constant>customerPaymentStatusReportV03</constant>
                </setHeader>
                
                <to ref="queue_esb" />
                </route>

        </camel-osgi:camelContext>

--
View this message in context: 
http://camel.465427.n5.nabble.com/global-onException-clause-wrongly-identifies-route-in-which-exception-occurs-log-name-tp5058304p5058304.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to