net.sf.cglib.CodeGenerationException

Hibernate JIRA | Dominik Roblek | 1 decade ago
  1. 0

    I have some persistent classes, which cannot be instrumented with CGLIB reflection optimizer. In Hibernate versions prior to 2.1beta4 I've got the following correct log messages and everything worked fine: --- 14:26:48,230 INFO [:] SessionFactoryImpl:109 - building session factory 14:26:57,507 INFO [:] ReflectHelper:328 - reflection optimizer disabled for: si.marand.maf.server.jastreb.party.module.entity.PersonEntity, NullPointerException: null 14:26:59,175 INFO [:] ReflectHelper:328 - reflection optimizer disabled for: si.marand.maf.server.jastreb.party.module.entity.BankEntity, NullPointerException: null 14:27:06,349 INFO [:] SessionFactoryObjectFactory:86 - Factory name: maf-server-hibernate-sessionFactory --- But in version 2.1beta4 is instead of this in the same phase of startup process thrown an exception, which stops application. The excerption from log it here: --- 12:18:51,464 ERROR [:] LazyInitializer:62 - CGLIB Enhancement failed net.sf.cglib.CodeGenerationException at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:200) at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:186) at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:181) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:222) at net.sf.cglib.Enhancer.enhance(Enhancer.java:149) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:52) at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:754) at net.sf.hibernate.persister.NormalizedEntityPersister.<init>(NormalizedEntityPersister.java:737) at net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:63) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:132) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:660) ... --- Besides of this bug it seems, that hibernate.cglib.use_reflection_optimizer setting is ignored in beta4 and "true" is allways used as it's value. Dominik

    Hibernate JIRA | 1 decade ago | Dominik Roblek
    net.sf.cglib.CodeGenerationException
  2. 0

    I have some persistent classes, which cannot be instrumented with CGLIB reflection optimizer. In Hibernate versions prior to 2.1beta4 I've got the following correct log messages and everything worked fine: --- 14:26:48,230 INFO [:] SessionFactoryImpl:109 - building session factory 14:26:57,507 INFO [:] ReflectHelper:328 - reflection optimizer disabled for: si.marand.maf.server.jastreb.party.module.entity.PersonEntity, NullPointerException: null 14:26:59,175 INFO [:] ReflectHelper:328 - reflection optimizer disabled for: si.marand.maf.server.jastreb.party.module.entity.BankEntity, NullPointerException: null 14:27:06,349 INFO [:] SessionFactoryObjectFactory:86 - Factory name: maf-server-hibernate-sessionFactory --- But in version 2.1beta4 is instead of this in the same phase of startup process thrown an exception, which stops application. The excerption from log it here: --- 12:18:51,464 ERROR [:] LazyInitializer:62 - CGLIB Enhancement failed net.sf.cglib.CodeGenerationException at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:200) at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:186) at net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:181) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:222) at net.sf.cglib.Enhancer.enhance(Enhancer.java:149) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:52) at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:754) at net.sf.hibernate.persister.NormalizedEntityPersister.<init>(NormalizedEntityPersister.java:737) at net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:63) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:132) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:660) ... --- Besides of this bug it seems, that hibernate.cglib.use_reflection_optimizer setting is ignored in beta4 and "true" is allways used as it's value. Dominik

    Hibernate JIRA | 1 decade ago | Dominik Roblek
    net.sf.cglib.CodeGenerationException

    Root Cause Analysis

    1. net.sf.cglib.CodeGenerationException

      No message provided

      at net.sf.cglib.ReflectUtils.newInstance()
    2. net.sf.cglib
      Enhancer.enhance
      1. net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:200)
      2. net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:186)
      3. net.sf.cglib.ReflectUtils.newInstance(ReflectUtils.java:181)
      4. net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:222)
      5. net.sf.cglib.Enhancer.enhance(Enhancer.java:149)
      5 frames
    3. net.sf.hibernate
      Configuration.buildSessionFactory
      1. net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:52)
      2. net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:754)
      3. net.sf.hibernate.persister.NormalizedEntityPersister.<init>(NormalizedEntityPersister.java:737)
      4. net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:63)
      5. net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:132)
      6. net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:660)
      6 frames