You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by milltj <mi...@drop-tank.com> on 2013/08/06 20:37:34 UTC
MojoExecutionException -Unmarshalling from XML
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"
xmlns:xsi="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/String;)V
-> [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
--
View this message in context: http://camel.465427.n5.nabble.com/MojoExecutionException-Unmarshalling-from-XML-tp5736861.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: MojoExecutionException -Unmarshalling from XML
Posted by Willem jiang <wi...@gmail.com>.
Hi,
It looks like there are more than one version of camel jars in you class path.
Can you double check it by running mvn dependency:tree?
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
On Wednesday, August 7, 2013 at 2:37 AM, milltj wrote:
> 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"
> xmlns:xsi="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/String;)V
> -> [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
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/MojoExecutionException-Unmarshalling-from-XML-tp5736861.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).