• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HibernateException

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic