Eight Stars

Convert XML to JSON in mediation route

Hi,

 

I would like to transform an XML to JSON in a route.

 

I created a basic route:

Capture.PNG

 

With my first cFile, I pick up a XML file.

 

In my cJavaDSLProcessor, I entered (According to http://camel.apache.org/xmljson.html):

Capture.PNG

 

And my second cFile component is supposed to put down my JSON file.

 

In my cConfig component, I added this jar:

-camel-xmljson-alldep-2.16.3.jar

 

  

 But I get this exception "java.lang.NoClassDefFoundError: nu/xom/Serializer" when running the route...

 

Eric

1 ACCEPTED SOLUTION

Accepted Solutions
Eight Stars

Re: Convert XML to JSON in mediation route

I fixed the issue adding these three jars:

-xom-1.2.7.jar (Without it I have this exception "java.lang.NoClassDefFoundError: nu/xom/Serializer"
-commons-lang-2.6.jar (Without it I have this exception "java.lang.NoClassDefFoundErrorSmiley Surprisedrg/apache/commons/lang/exception/NestableRuntime" )
-commons-collections-3.2.2.jar (Without it have this exception "java.lang.ClassNotFoundException: org.apache.commons.collections.map.ListOrderedMap")

 

It works now.

 

Eric

1 REPLY
Eight Stars

Re: Convert XML to JSON in mediation route

I fixed the issue adding these three jars:

-xom-1.2.7.jar (Without it I have this exception "java.lang.NoClassDefFoundError: nu/xom/Serializer"
-commons-lang-2.6.jar (Without it I have this exception "java.lang.NoClassDefFoundErrorSmiley Surprisedrg/apache/commons/lang/exception/NestableRuntime" )
-commons-collections-3.2.2.jar (Without it have this exception "java.lang.ClassNotFoundException: org.apache.commons.collections.map.ListOrderedMap")

 

It works now.

 

Eric