Convert Json to XML

One Star

Convert Json to XML

Hi, Can someone please elaborate how to covert data from JSON to xml using Unmarshalling technique in Talend ESB. Is there any class or package available. 
Thanks
Yam
Moderator

Re: Convert Json to XML

Hi,
Do you want to convert json to xml in Talend ESB route? 
Here is a camel component:http://camel.apache.org/xmljson.html
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
One Star

Re: Convert Json to XML

Hi Sabrina,
Thanks for your comments.I am a beginner in Talend ESB.Do you have any tutorial to guide how to convert json file into xml file.Please suggest
Regards
Yam
One Star

Re: Convert Json to XML

Dear Talend Team,
I have created the flow by referring the above link. But ended up in exception. The exception text says " Caused by: java.lang.ClassNotFoundException: org.apache.camel.dataformat.xmljson.XmlJsonDataFormat "Could you please let me know how to fix this issues
1.Created XML to JSON flow
2.Imported Jar file
3.Referred the class path 
Attaching the screenshot and error log

Starting job Test at 11:14 14/11/2016.
connecting to socket on port 3842
connected
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/camel/dataformat/xmljson/XmlJsonDataFormat
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at local_project.test_0_1.Test.configure(Test.java:99)
at org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:403)
at org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:343)
at org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:326)
at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:835)
at org.apache.camel.impl.DefaultCamelContext$1.call(DefaultCamelContext.java:832)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2873)
at org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:832)
at org.apache.camel.main.MainSupport.postProcessCamelContext(MainSupport.java:465)
at org.apache.camel.main.MainSupport.postProcessContext(MainSupport.java:438)
at org.apache.camel.main.Main.doStart(Main.java:125)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.main.MainSupport.run(MainSupport.java:138)
at local_project.test_0_1.Test.run(Test.java:172)
at local_project.test_0_1.Test.runJobInTOS(Test.java:234)
at local_project.test_0_1.Test.main(Test.java:204)
Caused by: java.lang.ClassNotFoundException: org.apache.camel.dataformat.xmljson.XmlJsonDataFormat
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 28 more
java.txt.txt