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
#1
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="http://www.springframework.org/schema/beans" >
xmlnssmiliesi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

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


<camel:camelContext xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<jaxb id="jaxb" contextPath="com.mycompany.camel.loyalty"/>
</dataFormats>

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

</beans>

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!

Thanks

-Tim
davsclaus (413) [Avatar] Offline
#2
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:

http://camel.apache.org/support.html
http://camel.apache.org/discussion-forums.html
http://camel.apache.org/mailing-lists.html

This forum is intended for discussing the book.