Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Exception in thread "main" java.lang.NoClassDefFoundError while building SessionFactory ?

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


I am executing the Cliet Appliction for Hibernate but i am getting Error as below:
earlier i had mysql connectivity problem with user and database access related issue which i have fixed it and now i am facing the problem which is related to some classpath i think ..

Jan 19, 2010 1:03:05 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Exception in thread "main" java.lang.NoClassDefFoundError
at org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at Test.main(Test.java:11)
Caused by: java.lang.ClassNotFoundException: net.sf.cglib.transform.impl.InterceptFieldEnabled
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
... 8 more

could any one give me pointer to fix it !

Regards,
Prabhat
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fixed the issue by myself.

actually the problem was mising some jar files in classpath lib.

i have added few jar files :

1) asm-atttrs.jar
2) asm.jar
3) jta.jar
4) cglib.jar

evreything is working fine now !

Good Learning exp..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic