This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes HibernateException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HibernateException" Watch "HibernateException" New topic
Author

HibernateException

Yudi Ono
Greenhorn

Joined: Aug 24, 2008
Posts: 12
hi, i'am new to hibernate
when i compile the program the result is this :

[root@server-area2 Software]# java -jar replikasi.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/HibernateException
at org.replikasi.tebarpesona.MainAction.main(MainAction.java:21)
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
... 1 more

what could be wrong?

thanks

regards
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

It probably means you are missing jars from the classpath. I ran into this problem recently, and it didn't seem to me that the Hibernate docs addressed it very well. I got sample programs from the Manning Hibernate book running with the following jars:

antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
hibernate-cglib-repack-2.1_3.jar
hibernate3.jar
javassist-3.4.GA.jar
jta-1.1.jar
slf4j-api-1.5.2.jar
hsqldb.jar
log4j-1.2.15.jar
slf4j-log4j12-1.5.2.jar

I believe you can swap log4j with commons-logging if you prefer.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Greg Charles wrote: I ran into this problem recently, and it didn't seem to me that the Hibernate docs addressed it very well.


When you extract hibernate distro (2.x) you'll have README inside lib directory which lists all the required,optional etc.. And in 3.x they have separated them in to required,optional etc.. inside lib directory.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

Vijitha Kumara wrote:
Greg Charles wrote: I ran into this problem recently, and it didn't seem to me that the Hibernate docs addressed it very well.


When you extract hibernate distro (2.x) you'll have README inside lib directory which lists all the required,optional etc.. And in 3.x they have separated them in to required,optional etc.. inside lib directory.


Ah, but the problem is they aren't right. There are several jars that are required, but not mentioned in the required list. If I remember right, there are two or three required jars not mentioned in any of the lists. I found that a bit frustrating.
 
Consider Paul's rocket mass heater.
 
subject: HibernateException
 
Similar Threads
help !!
Tomcat Error
Hibernate configuration problem
why is this happening REALLY URGENT
ClassNotFoundException exception