java - Apache camel Tests fails with : Could not refresh JMS Connection for destination 'null' - retrying in 5000ms. cause: null -
i have annoying problem have developed , tested apache camel module larger application, looking great until committed code main repository , jenkins tried build , run tests.
locally (on windows machine) maven builds , runs fine on our jenkins server (linux) fails every single test error.
could not refresh jms connection destination 'null' - retrying in 5000ms. cause: null the application simple, accepts messages 1 queue, validation , transformation , send out on queue.
on machine mocked endpoints can asserted expected values while on our jenkins server these mocked endpoint assertions timed-out after 10 seconds. not work load issue test data processed in milliseconds on machine. can see expect happen happens in our logs.
the application built on spring 3.2.14, uses apache camel 2.15.2 , testing purposes i'm using activemq 5.11.1. have made sure there 1 version of each framework there shouldn't conflicts (checked mvn dependency:tree)
i not permitted show of code i'll make post without it.
any suggestion might cause appreciated.
edit1:
here's camel routes (simplified):
// camel route : entry point @inject private queue queueinn; @override public void configure() throws exception { from("jms:queue:" + queueinn.getname())) .routeid(route_name) .multicast() // todo add additional routes add them parameter list to(queuea, queueb, .....) .to(queuea.in_queue) .end(); } // camel route b: basic logic @override public void configure() throws exception { from(in_queue) .routeid(route_name) .process(new mdccontextprocessor()) //error handling .onexception(throwable.class) .setbody(exchangeproperty(commonproperties.original_message)) .log(logginglevel.error, log, "... \n${exception.message} \n${exception.stacktrace}") .to(queueutil.getcamelqueue(errorqueue)) .log(logginglevel.error, log, "...") .stop() .end() // processing .log(logginglevel.debug, log, "...") .setproperty(commonproperties.original_message, body()) .to("validator:" + xsd_a) .unmarshal(jaxbformata) .choice() .when(predicatea) .log(logginglevel.debug, log, "...") .process(mappera) .marshal(jaxbformatb) .convertbodyto(string.class) .to("validator:" + xsd_b) .to("jms:queue:" + queueout.getname()) .log(logginglevel.debug, log, "...") .otherwise() .log(logginglevel.debug, log, "...") .endchoice(); }
update 2:
after lot of debugging , testing have concluded our problem related our camel test context, when no other tests ran expect our camel tests run fine, if have other spring tests use same config our camel tests, mocked endpoints start behaving strangely. case when our normal spring tests executed before our camel tests. if our camel tests first run, work fine. difference between our local build , our ci server , cause of our problem.
update 3: have temporarily workaround problem, use @dirtiescontext on other tests uses test context. while works, prefer able tell camel test class needs create new fresh context before starts running tests, know how might this?
Comments
Post a Comment