I'm trying to use XStream. I've added the XStream executable Jar file to my project. Executing the following command:
XStream xstream = new XStream();
Is resulting in the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
at com.thoughtworks.xstream.XStream.<init>(XStream.java:350)
at xstream_test.XmlTrasformer.objectToXml(XmlTrasformer.java:56)
at xstream_test.XmlTrasformer.main(XmlTrasformer.java:31)
Caused by: java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more
Any idea I might have done wrong? Thanks.
Make sure you have included all the jars that come with XStream also specially "kxml2.jar" and "xmlpull-1.1.3.1.jar" file. Jar version may deffer incase of yours.