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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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.