Discussion:
Setting up XStream with netbeans gives java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver
Erik Malm
2011-09-12 05:17:57 UTC
Permalink
Hello everyone, I've been going slightly mad trying to figure out how to get netbeans IDE and XStream to work together so any help would be appreciated. I've set up a library for xstream and included all .jar files from the distribution. I've also downloaded the source dist and pointed the library to it.



The appearance from within the IDE is that all classes are found, it autocompletes classnames etc and automatic compile on save builds show no errors. However when actually building the code I keep getting:

java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver error traced back to this line of code:

HierarchicalStreamDriver driver = new Xpp3Driver();

Removing it and just doing XStream test = new XStream(); also throws the same error.



I've opened the .jars and HierarchicalStreamDriver.class is definitley present in the XStream.1.4.1.jar which is included in the library.



Anyone have experience setting up XStream for Netbeans? Any information would be appreciated at this point since I'm completely stumped.



Thanks...
Jörg Schaible
2011-09-12 08:58:48 UTC
Permalink
Hi Erik,
Post by Erik Malm
Hello everyone, I've been going slightly mad trying to figure out how to
get netbeans IDE and XStream to work together so any help would be
appreciated. I've set up a library for xstream and included all .jar files
from the distribution. I've also downloaded the source dist and pointed
the library to it.
The appearance from within the IDE is that all classes are found, it
autocompletes classnames etc and automatic compile on save builds show no
com/thoughtworks/xstream/io/HierarchicalStreamDriver error traced back to
HierarchicalStreamDriver driver = new Xpp3Driver();
Removing it and just doing XStream test = new XStream(); also throws the same error.
I've opened the .jars and HierarchicalStreamDriver.class is definitley
present in the XStream.1.4.1.jar which is included in the library.
Anyone have experience setting up XStream for Netbeans? Any information
would be appreciated at this point since I'm completely stumped.
I have no idea, why you should not be able to use XStream in a project
managed by Netbeans. As you've already found out, the driver is in the
XStream core library and you should be able to use XStream without further
dependency when you're using the StaxDriver or DomDriver. On the other side,
I've never used Netbeans myself, but I cannot imagine an IDE failing with
its core functionality ?!?

- Jörg


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

http://xircles.codehaus.org/manage_email
Paul Hammant
2011-09-12 11:28:34 UTC
Permalink
Can you show us the full stack trace for that exception including your lines
of code ?

For a separate test using the same library, can you directly 'new up'
HierarchicalStreamDriver
?

- Paul
Post by Erik Malm
Hello everyone, I've been going slightly mad trying to figure out how to
get netbeans IDE and XStream to work together so any help would be
appreciated. I've set up a library for xstream and included all .jar files
from the distribution. I've also downloaded the source dist and pointed the
library to it.
The appearance from within the IDE is that all classes are found, it
autocompletes classnames etc and automatic compile on save builds show no
com/thoughtworks/xstream/io/HierarchicalStreamDriver error traced back to
HierarchicalStreamDriver driver = new Xpp3Driver();
Removing it and just doing XStream test = new XStream(); also throws the same error.
I've opened the .jars and HierarchicalStreamDriver.class is definitley
present in the XStream.1.4.1.jar which is included in the library.
Anyone have experience setting up XStream for Netbeans? Any information
would be appreciated at this point since I'm completely stumped.
Thanks...
Loading...