The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

milltj (2) [Avatar] Offline
Hey everyone, I am in the process of learning how to route with Camel and am having an issue with unmarshalling a Jaxb message. The scenerio is such that I have a processor bean that is intended to process the data after the XML has been unmarshalled. I put a jaxb.index file in the com.mycompany.camel.loyalty directory and listed all the Jaxb classes in that file. My Camel-Context is as follows:

<beans xmlns="" >

<bean id="SiteBean" class="com.mycompany.camel.beans.SiteBean"></bean>

<camel:camelContext xmlns="">
<jaxb id="jaxb" contextPath="com.mycompany.camel.loyalty"/>

<from uri="file:/Camel/CamelTest3/files/from?noop=true"/>
<unmarshal ref="jaxb"/>
<process ref="SiteBean" />
<to uri="file:/Camel/CamelTest3/files/to"/>


When I issue the command "mvn camel:run" I receive the following error message:

[ERROR] Failed to execute goal org.apache.camel:camel-maven-plugin:2.11.1:run (default-cli) on project CamelTest3: null: MojoExecutionException: InvocationTargetException: org.apache.camel.util.ObjectHelper.notNull(Ljava/lang/Object;Ljava/lang/StringsmilieV -> [Help 1]

Not sure exactly what this means. If I remove the <unmarshal> tag it will run, but I get this error everytime. Any assistance would be greatly appreciated!


davsclaus (413) [Avatar] Offline
Re: Jaxb Unmarshal error
The error could indicate you have mixed versions of Apache Camel on the classpath. I suggest to double check you are only using the same version of Camel.

And for getting help with Apache Camel its better to use the Apache community for that. See details in the appendix in the book, and here as well:

This forum is intended for discussing the book.