Hi Claus, I'm actually not changing the error handler using adviceWith. My spring application context file defines a single error handler, which I reference as an attribute on the camelContext tag to make it context-scoped. When I subsequently simulate an error using advice with, I get the exception. If I modify the application context file and move the error handler ref attribute to the route that I am advising, everything works as expected.
My test method that is using adviceWith is as follows: @Test public void testSimulateConnectionError() throws Exception { RouteDefinition route = context.getRouteDefinition("fileSystemToFtp"); route.adviceWith(context, new RouteBuilder() { @Override public void configure() throws Exception { interceptSendToEndpoint(sterlingWomsFtpPath) .skipSendToOriginalEndpoint() .process(new SimulateHttpErrorProcessor()); } }); // mocks and assertions } -- View this message in context: http://camel.465427.n5.nabble.com/Error-Handling-with-Spring-XML-tp4296920p4298303.html Sent from the Camel - Users mailing list archive at Nabble.com.