Hi !
I have the following architecture :
FilePoller (in directory) -> Camel (routing on xml) -> JmsQueue (depending
on routing result)
When a put a xml file in in directory, all is ok. Routing works perfectly.
When a put a wrong xml file format, I received an IOException that loops
forever with the filepoller.
So I put a OnException management in camel for IOException Like this :
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from
uri="jbi:service:http://esb.transfolio.parkeon.com/camelRouter" />
<onException>
<exception>java.io.IOException</exception>
<to
uri="jbi:endpoint:http://esb.com/fileSender/errorFile" />
<choice>
<when>
<xpath>count(/rep) =
1</xpath>
<to
uri="jbi:endpoint:http://esb.com/JMSProviderService/inQueueWriterRept" />
</when>
<when>
<xpath>count(/aud) = 1
</xpath>
<to
uri="jbi:endpoint:http://esb.com/JMSProviderService/inQueueWriterAud" />
</when>
<when>
<xpath>count(/stat) =
1</xpath>
<to
uri="jbi:endpoint:http://esb.com/JMSProviderService/inQueueWriterStat" />
</when>
<otherwise>
<to
uri="jbi:endpoint:http://esb.com/fileSender/unknownFile" />
</otherwise>
</choice>
</onException>
</route>
</camelContext>
When a wrong file (not xml file format but named "something.xml") is put in
in directory I have the following messages :
java.lang.NullPointerException
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
at
org.apache.servicemix.camel.CamelProviderEndpoint.handleActiveProviderExchange(CamelProviderEndpoint.java:94)
at
org.apache.servicemix.camel.CamelProviderEndpoint.process(CamelProviderEndpoint.java:73)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:600)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:554)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:510)
at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:620)
at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Where am I wrong?
Thanks.
--
View this message in context:
http://www.nabble.com/How-to-manage-IOException-with-Camel---tp22471241p22471241.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.