Saturday, November 24, 2012

Hibernate Error : java.lang.NoClassDefFoundError: org/objectweb/asm/Type

This is the common error we will be getting when working on the Hibernate.
Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type
 at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.java:180)
 at net.sf.cglib.core.KeyFactory.(KeyFactory.java:66)
 at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69)
 at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117)
 at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43)
 at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162)
 at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:135)

This was due to the one of the asm jar missing in your /WEB-INF/lib directory. You can download it from their official directory ASM, or you can use the springsource object jar, which can be downloaded here

Happy Programming !!!