Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jar - HibernateException

804769Dec 22 2010 — edited Dec 22 2010
Hello,

I have a working code that I would like to export as a jar file. I am using Eclipse, and failing with the manifest file. Moved all the jar files that are included in the Java Build Path > Libraries. Here is the manifest file:
Manifest-Version: 1.0
Created-By: 1.6.0_23 (Sun Microsystems Inc.)
Class-Path: lib/antlr-2.7.6.jar lib/asm-attrs.jar lib/asm.jar lib/c3p0-0.9.1.jar lib/cglib-2.1.3.jar 
 lib/charsets.jar lib/commons-collections-2.1.1.jar lib/commons-logging-1.0.4.jar lib/concurrent-1.3.2.jar 
 lib/connector.jar lib/dnsns.jar lib/dom4j-1.6.1.jar lib/ehcache-1.2.3.jar lib/ejb3-persistence.jar 
 lib/hibernate-annotations.jar lib/hibernate-commons-annotations.jar lib/hibernate-entitymanager.jar 
 lib/hibernate-validator.jar lib/hibernate3.jar lib/jaas.jar lib/jacc-1_0-fr.jar lib/javassist.jar 
 lib/jaxen-1.1-beta-7.jar lib/jboss-archive-browsing.jar lib/jboss-cache.jar lib/jboss-common.jar 
 lib/jboss-jmx.jar lib/jboss-system.jar lib/jce.jar lib/jdbc2_0-stdext.jar lib/jgroups-2.2.8.jar 
 lib/jsse.jar lib/jta.jar lib/localedata.jar lib/log4j-1.2.11.jar lib/ooxml-schemas-1.0.jar 
 lib/oscache-2.1.jar lib/poi-3.5-FINAL-20090928.jar lib/poi-ooxml-3.5-FINAL-20090928.jar 
 lib/proxool-0.8.3.jar lib/resources.jar lib/rt.jar lib/sqljdbc4.jar lib/sunjce_provider.jar 
 lib/sunmscapi.jar lib/sunpkcs11.jar lib/swarmcache-1.0rc2.jar lib/xerces-2.6.2.jar lib/xml-apis.jar 
 lib/xmlbeans-2.4.0.jar lib/hibernate-tools.jar lib/hibernate-search.jar
Main-Class: packageName.ClassName
And the error I get:
C:\>java -jar DBS.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/Hiberna
teException
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
        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)
Could not find the main class: packageName.ClassName. Program will exit.

C:\>
This post has been answered by JoachimSauer on Dec 22 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2011
Added on Dec 22 2010
4 comments
481 views