AnsweredAssumed Answered

NPE on CamelBehavior createExchange

Question asked by sdeschenes on Aug 17, 2015
Latest reply on Aug 19, 2015 by trademak

I've got a WARN in my log using camel 2.16.0-SNAPSHOT and activiti. I know, you're not there yet, but I've got an issue with 2.15.2 wich is resolved in 2.16.0, so…

The problem seems to come from the use of a DefaultExchange in CamelBehavior. That stuff:
Exchange ex = new DefaultExchange(camelContextObj);
(line 135) seems to generate an NPE, because it doesn't set the necessary properties on the exchange for the event to be notified correctly.

I've fork Activiti and replace it with 
Exchange ex = endpoint.createExchange();
and everything seems to work fine now. (including tests).

So, in prevention of a futur issue/ npe warning, can you change the way the exchange is created? Do you want me to do a pull request with the modification?