Frage

I'm trying to use the Lizzy library (http://lizzy.sourceforge.net/) to do some playlist manipulation. As a dependency, it requires that I have the Castor library (http://www.castor.org/) in my build path. So I went to the site, and downloaded Castor 1.3.1, then put the .jar into my build path.

However, when I try to run this line of code to convert a specific playlist file to a generic playlist object:

specificPlaylist = SpecificPlaylistFactory.getInstance().readFrom(playlistFile);

I end up getting a NoClassDefFoundError:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/exolab/castor/core/exceptions/CastorException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(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 sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.exolab.castor.mapping.Mapping.<init>(Mapping.java:81)
    at christophedelory.xml.XmlSerializer.getMapping(XmlSerializer.java:100)
    at christophedelory.playlist.asx.AsxProvider.readFrom(AsxProvider.java:202)
    at christophedelory.playlist.SpecificPlaylistFactory.readFrom(SpecificPlaylistFactory.java:132)
    at christophedelory.playlist.SpecificPlaylistFactory.readFrom(SpecificPlaylistFactory.java:168)
    ...

Am I missing a .jar file? I managed to create an instance of a CastorException class (but it was in a different package than the one the exception is talking about). I thought that the basic Castor-1.3.1.jar file held all of the classes it needed.

Additional information: I'm trying to decode a .wpl playlist file, which should be supported by Lizzy. And my build path looks like this:

My Build Path

Thanks for any help.

War es hilfreich?

Lösung

You can easily look in the Castor jar to see what's there using a wide variety of tools - WinZip happens to be my tool of choice. You'll find that while there's a CastorException, it's in the wrong package.

Looking at the old downloads page under 1.3.1, I see a Castor-1.3.1-core.jar. Looking in it, I see CastorException in the right package. You may need other jars too - I'd consult the documentation, or continue by trial-and-error, or try to find a POM that will tell you.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top