You're going to have to give more specifics on your execution environment (jar?, war?, within ide?, app server?, classpath?). It looks like xstream is on the class path at compile time, but not on the classpath when your code is running.
-----Original Message----- From: Ramjet [mailto:[email protected]] Sent: Friday, June 08, 2012 5:00 PM To: [email protected] Subject: [xstream-user] Android / Eclipse XStream can't instantiate? Could not find class 'com.thoughtworks.xstream.XStream' Hello, I am beating my head against a brick wall it seems. I add the xstream-1.4.2 to my java build path and call it from my code no problems: XStream yyz = new XStream(); String str_xml = yyz.toXML(ld_data); When I run it however the XStream object doesn't create and instead I get a classnotfoundexception???? This is costing me quite a bit of time as I have been unable to figure out what is missing. I even added EVERYTHING that comes with the download in case there was a dependancy...no dice. Here is the full trace: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.thoughtworks.xstream.XStream at org.gpgvm.ironmike.IcyArmActivity.onOptionsItemSelected (IcyArmActivity.java:166) at android.app.Activity.onMenuItemSelected(Activity.java:2205) at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected (PhoneWindow.java:748) at com.android.internal.view.menu.MenuItemImpl.invoke (MenuItemImpl.java:143) at com.android.internal.view.menu.MenuBuilder.performItemAction (MenuBuilder.java:855) at com.android.internal.view.menu.IconMenuView.invokeItem (IconMenuView.java:532) at com.android.internal.view.menu.IconMenuItemView.performClick (IconMenuItemView.java:122) at android.view.View$PerformClick.run(View.java:9080) at android.os.Handler.handleCallback(Handler.java:587) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.XStream in loader dalvik.system.PathClassLoader[/data/app/org.gpgvm.ironmike-2.apk] at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) at java.lang.ClassLoader.loadClass(ClassLoader.java:551) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) ... 17 more --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
