Hi Liviu,
Liviu wrote:
>>
>> 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...
No problem.
> 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
Basically you're missing xpp3_min now. However, for *writing* XML only, you
don't even need that (no XML parser involved), so your example should work
(and it works for me):
================ %< ================
$ java -cp .:xstream-1.4.1.jar:xmlpull-1.1.3.1.jar Xtest
<Person>
<firstname>nume</firstname>
<lastname>pre</lastname>
</Person>
$ ls -l
total 632
-rw-r--r-- 1 joehni users 246 Nov 21 18:30 Person.class
-rw-r--r-- 1 joehni users 77 Nov 21 18:30 Person.java
-rw-r--r-- 1 joehni users 672 Nov 21 18:30 Xtest.class
-rw-r--r-- 1 joehni users 418 Nov 21 18:30 Xtest.java
-rw-r--r-- 1 joehni users 7188 Nov 21 18:31 xmlpull-1.1.3.1.jar
-rw-r--r-- 1 joehni users 495701 Nov 21 18:25 xstream-1.4.1.jar
================ %< ================
[snip]
> Is there something else to be done?
Try to compare. Something must be different on your side (the operating
system should not result in any difference here).
Cheers,
Jörg
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email