> 
> You miss the dependency to xmlpull. Sorry, but I cannot say something else. 
> This is what the error indicates.
> 
> - Jörg


I'm fairly new to java, so please bear with me on this one...

I wrote a simple test file to run outside Eclipse to eliminate one of the
things that might go wrong. There are two java source files and all the jars
from the xstream distribution put in one single directory.

The source files are:

//************** file Xtest
import com.thoughtworks.xstream.XStream;

public class Xtest {
        public static void main(String[] args){
                XStream xstream = new XStream();
                Xtest x = new Xtest();
                Person joe = new Person();
                joe.firstname="nume";
                joe.lastname="pre";
                String xml = xstream.toXML(joe);
                System.out.println(xml);
        }
}
//************** EOF Xtest

//************** file Person
public class Person {
  public String firstname;
  public String lastname;
}
//************** EOF Person

Compiles fine with:
javac.exe Xtest.java -classpath xstream-1.4.1.jar;.

Tried to run as:
java -cp .;xstream-1.4.1.jar;xmlpull-1.1.3.1.jar Xtest

Got:
Exception in thread "main" java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPul
lParserException
        at com.thoughtworks.xstream.XStream.<init>(XStream.java:336)
        at Xtest.main(Xtest.java:6)
Caused by: java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserExcepti
on
        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 java.lang.ClassLoader.loadClass(Unknown Source)
        ... 2 more

Is there something else to be done?


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to