cancel
Showing results for 
Search instead for 
Did you mean: 

Getting NotSerializableException from DefaultMessageHistory

bogdan_aioanei
Champ in-the-making
Champ in-the-making
Hello everyone,

I'm new to Apache Camel and have been trying to integrate it with Activiti BPMN engine.

I have a very simple BPMN process that has a serviceTask of type 'camel' and two routes defined in a SpringRouteBuilder like so:


public class CamelHelloRoute extends SpringRouteBuilder {

        @Override
        public void configure() throws Exception {
                from("activiti:camelTestProcess:camelTaskId").log(LoggingLevel.INFO, "Received message in CAMEL " + property("var1")).setProperty("greeting").constant("ceva").setBody().properties();

                from("direct:start").to("activiti:camelTestProcess");
        }
}

I wrote a unit test to see if my property ("var1") has the value I set in the test and also to check if another property ("greeting") is being set. When I run the test I get a NotSerializableException, stack trace in the attached file, and I don't know why this is happening.

If I don't try to set the "greeting" property then everything is ok. I tried to disable message history on the context but I still got the same problem. And the logging isn't even working in either scenario.

Am I missing something? I'm using Spring with Camel configured via Java by extending the CamelConfiguration class. Is there any extra configuration that needs to be done?

Thanks,
Bogdan
2 REPLIES 2

sathish1
Champ in-the-making
Champ in-the-making
The only thing I see that is different in your code-base is the <Code>@Component</code> declaration before the class declaration of  <block>CamelHelloRoute </block> . Cheers.

bogdan_aioanei
Champ in-the-making
Champ in-the-making
Hi sathish,

The @Component declaration is needed because I'm using the CamelConfiguration class to setup Camel in my project.
The JavaDoc for the class mentions the following:

"Unless {@link #routes()} method is overridden, this configuration automagically load all the {@link org.apache.camel.builder.RouteBuilder} instances available in the Spring context."

Is there anything else you might have noticed?