Hi Ashwin,

Thanks for your reply.

adviceRoute javadocs mentioned "Will stop and remove the old route from camel context and add and start this new advised route."

When tried with restarting camel context, got NPE while advice route for start interception
Exception in thread "main" java.lang.NullPointerException
at org.apache.camel.impl.DefaultCamelContext.stopRouteService(DefaultCamelContext.java:1564) at org.apache.camel.impl.DefaultCamelContext.stopRoute(DefaultCamelContext.java:651) at org.apache.camel.impl.DefaultCamelContext.removeRouteDefinition(DefaultCamelContext.java:596) at org.apache.camel.model.RouteDefinition.adviceWith(RouteDefinition.java:221)
    at CamelContextLoader.addStartIntercepter(CamelContextLoader.java:54)
    at CamelContextLoader.load(CamelContextLoader.java:21)
    at CamelContextLoader.main(CamelContextLoader.java:105)

When tried with restarting route which is getting modified and got exception Exception in thread "main" java.lang.IllegalArgumentException: Cannot add a 2nd consumer to the same endpoint. Endpoint Endpoint[direct://input] only allows one consumer. at org.apache.camel.component.direct.DirectConsumer.doStart(DirectConsumer.java:45)

as route is already started when we do adviceRoute.

Attaching modified code.

Thanks,
Sumit Teke
Omniscient Software Pvt Ltd
T. +91-20-26680814, Ext. 217
F. +91-20-26680815, Ext. 212
M. +91-9975709032
E. sumit_t...@omniscient.co.in

On Monday 07 February 2011 06:50 PM, Ashwin Karpe wrote:
Hi,

I took a look at your code and I see that when you add interceptors you do
not stop the running camel context or the routes and then re-start it the
context or routes after adding the interceptors.

Please update your code and try again.

Cheers,

Ashwin...

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer&  Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com http://fusesource.com

Blog: http://opensourceknowledge.blogspot.com
http://opensourceknowledge.blogspot.com
---------------------------------------------------------

Attachment: camel-sample.tar.gz
Description: GNU Zip compressed data

Reply via email to