Menu

Persistence Tutorial - Lesson 10 - NoClassDef

2012-03-14
2013-04-09
  • Gerhard Ungerer

    Gerhard Ungerer - 2012-03-14

    I created the jar file as directed.  The code works all the way until a call is made to the MyUtilities static methods.  At that point, I get the error below.

    I included the MyUtilities in the jar file when it was created, so I am not sure what the problem is.

    The strange thing is that it works fine when running in Eclipse, but when running from the command line, the following message is thrown.

    Exception in thread "main" java.lang.NoClassDefFoundError: com/thoughtworks/xstr
    eam/io/HierarchicalStreamDriver
            at org.persistence.tutorial.MyLibrary.main(MyLibrary.java:139)
    Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.Hierarc
    hicalStreamDriver
            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)
            … 1 more

     
  • Mark Dexter

    Mark Dexter - 2012-03-14

    It sounds like your manifest.txt file is not correct. This file must be formatted exactly right. For example, it must end with a blank line. Check it against the example on page 25 of the PDF. Good luck. Mark

     
  • Gerhard Ungerer

    Gerhard Ungerer - 2012-03-15

    THANK YOU!!  The empty line fixed it.  Wow, I didnt expect it to be that finicky.  What threw me is that the BOOK and PERSON classes were fine, but MYLIBRARY had issues.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.