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

NoClassDefFoundError net/sf/cglib/KeyFactory

 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any body pls give me advise how to resolve for the following error


D:\hibernate>java com.reddy.EventManager
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.0.3
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Environment <clinit>
INFO: JVM proxy support: true
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Configuration getConfigurationInput
Stream
INFO: Configuration resource: /hibernate.cfg.xml
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: Review.hbm.xml
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: com.reddy.Event -> EVENTS
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Configuration configure
INFO: Configured SessionFactory: null
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
Nov 2, 2005 11:39:16 AM net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.
java:297)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:627)
at com.reddy.Util.<clinit>(Util.java:22)
at com.reddy.EventManager.create(EventManager.java:37)
at com.reddy.EventManager.main(EventManager.java:27)
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.reddy.Util.<clinit>(Util.java:25)
at com.reddy.EventManager.create(EventManager.java:37)
at com.reddy.EventManager.main(EventManager.java:27)
Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.
java:297)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.
java:627)
at com.reddy.Util.<clinit>(Util.java:22)
... 2 more
[ November 02, 2005: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help, isn't really a good topic title, it tells us nothing about what your problem is.

It looks like you have a classpath issue, or a different version of the file based on what the classloader currently has.

Which jar is this file located?

Mark
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify that the cglib jar that came with Hibernate is in your classpath.

Also make sure you don't have any other versions of cglib in the classpath that may conflict.
 
Graham Thorpe
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response .Yes i didn`t set classpath cglib.jar .

Now its working after set the classpath .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic