java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • A runnable example is attached. Here is its output: INFO : org.hibernate.cfg.Environment - Hibernate 3.0.5 INFO : org.hibernate.cfg.Environment - hibernate.properties not found INFO : org.hibernate.cfg.Environment - using CGLIB reflection optimizer INFO : org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling INFO : org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml INFO : org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml INFO : org.hibernate.cfg.Configuration - Mapping resource: PrivateNullConstructor.hbm.xml INFO : org.hibernate.cfg.HbmBinder - Mapping class: classesThatCauseTheBug.PrivateNullConstructor -> table1 INFO : org.hibernate.cfg.Configuration - Mapping resource: FinalClass.hbm.xml INFO : org.hibernate.cfg.HbmBinder - Mapping class: classesThatCauseTheBug.FinalClass -> table2 INFO : org.hibernate.cfg.Configuration - Configured SessionFactory: null INFO : org.hibernate.cfg.Configuration - processing extends queue INFO : org.hibernate.cfg.Configuration - processing collection mappings INFO : org.hibernate.cfg.Configuration - processing association property references INFO : org.hibernate.cfg.Configuration - processing foreign key constraints INFO : org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!) INFO : org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1 INFO : org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false INFO : org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/pledgetally INFO : org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=pledgetallyuser, password=****} INFO : org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 4.0.21 INFO : org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.9 ( $Date: 2005/05/19 15:52:23 $, $Revision: 1.1.2.2 $ ) INFO : org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect INFO : org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions) INFO : org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) INFO : org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled INFO : org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled INFO : org.hibernate.cfg.SettingsFactory - JDBC batch size: 15 INFO : org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled INFO : org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled INFO : org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled INFO : org.hibernate.cfg.SettingsFactory - Connection release mode: null INFO : org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2 INFO : org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1 INFO : org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled INFO : org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled INFO : org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory INFO : org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory INFO : org.hibernate.cfg.SettingsFactory - Query language substitutions: {} INFO : org.hibernate.cfg.SettingsFactory - Second-level cache: enabled INFO : org.hibernate.cfg.SettingsFactory - Query cache: disabled INFO : org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider INFO : org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled INFO : org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled INFO : org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout INFO : org.hibernate.cfg.SettingsFactory - Statistics: disabled INFO : org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled INFO : org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo INFO : org.hibernate.impl.SessionFactoryImpl - building session factory WARN : net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/pcantrel/workspace/HHH471TestCaseToMakeGavinHappy/lib/ehcache-1.1.jar!/ehcache-failsafe.xml ERROR: org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: classesThatCauseTheBug.FinalClass java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) WARN : org.hibernate.tuple.PojoTuplizer - could not create proxy factory for:classesThatCauseTheBug.FinalClass org.hibernate.HibernateException: CGLIB Enhancement failed: classesThatCauseTheBug.FinalClass at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:108) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) Caused by: java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) ... 12 more ERROR: org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: classesThatCauseTheBug.PrivateNullConstructor java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) WARN : org.hibernate.tuple.PojoTuplizer - could not create proxy factory for:classesThatCauseTheBug.PrivateNullConstructor org.hibernate.HibernateException: CGLIB Enhancement failed: classesThatCauseTheBug.PrivateNullConstructor at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:108) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) Caused by: java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) ... 12 more INFO : org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured INFO : org.hibernate.impl.SessionFactoryImpl - Checking 0 named queries Trying to load FinalClass... java.lang.NullPointerException at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249) at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:603) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:596) at Main.main(Main.java:17) Trying to load PrivateNullConstructor... java.lang.NullPointerException at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249) at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:603) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:596) at Main.main(Main.java:27)
    via by Paul Cantrell,
  • A runnable example is attached. Here is its output: INFO : org.hibernate.cfg.Environment - Hibernate 3.0.5 INFO : org.hibernate.cfg.Environment - hibernate.properties not found INFO : org.hibernate.cfg.Environment - using CGLIB reflection optimizer INFO : org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling INFO : org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml INFO : org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml INFO : org.hibernate.cfg.Configuration - Mapping resource: PrivateNullConstructor.hbm.xml INFO : org.hibernate.cfg.HbmBinder - Mapping class: classesThatCauseTheBug.PrivateNullConstructor -> table1 INFO : org.hibernate.cfg.Configuration - Mapping resource: FinalClass.hbm.xml INFO : org.hibernate.cfg.HbmBinder - Mapping class: classesThatCauseTheBug.FinalClass -> table2 INFO : org.hibernate.cfg.Configuration - Configured SessionFactory: null INFO : org.hibernate.cfg.Configuration - processing extends queue INFO : org.hibernate.cfg.Configuration - processing collection mappings INFO : org.hibernate.cfg.Configuration - processing association property references INFO : org.hibernate.cfg.Configuration - processing foreign key constraints INFO : org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!) INFO : org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1 INFO : org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false INFO : org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/pledgetally INFO : org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=pledgetallyuser, password=****} INFO : org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 4.0.21 INFO : org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.9 ( $Date: 2005/05/19 15:52:23 $, $Revision: 1.1.2.2 $ ) INFO : org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect INFO : org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions) INFO : org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) INFO : org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled INFO : org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled INFO : org.hibernate.cfg.SettingsFactory - JDBC batch size: 15 INFO : org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled INFO : org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled INFO : org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled INFO : org.hibernate.cfg.SettingsFactory - Connection release mode: null INFO : org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2 INFO : org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1 INFO : org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled INFO : org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled INFO : org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory INFO : org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory INFO : org.hibernate.cfg.SettingsFactory - Query language substitutions: {} INFO : org.hibernate.cfg.SettingsFactory - Second-level cache: enabled INFO : org.hibernate.cfg.SettingsFactory - Query cache: disabled INFO : org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.EhCacheProvider INFO : org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled INFO : org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled INFO : org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout INFO : org.hibernate.cfg.SettingsFactory - Statistics: disabled INFO : org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled INFO : org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo INFO : org.hibernate.impl.SessionFactoryImpl - building session factory WARN : net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/pcantrel/workspace/HHH471TestCaseToMakeGavinHappy/lib/ehcache-1.1.jar!/ehcache-failsafe.xml ERROR: org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: classesThatCauseTheBug.FinalClass java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) WARN : org.hibernate.tuple.PojoTuplizer - could not create proxy factory for:classesThatCauseTheBug.FinalClass org.hibernate.HibernateException: CGLIB Enhancement failed: classesThatCauseTheBug.FinalClass at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:108) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) Caused by: java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) ... 12 more ERROR: org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: classesThatCauseTheBug.PrivateNullConstructor java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) WARN : org.hibernate.tuple.PojoTuplizer - could not create proxy factory for:classesThatCauseTheBug.PrivateNullConstructor org.hibernate.HibernateException: CGLIB Enhancement failed: classesThatCauseTheBug.PrivateNullConstructor at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:108) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10) Caused by: java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) ... 12 more INFO : org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured INFO : org.hibernate.impl.SessionFactoryImpl - Checking 0 named queries Trying to load FinalClass... java.lang.NullPointerException at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249) at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:603) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:596) at Main.main(Main.java:17) Trying to load PrivateNullConstructor... java.lang.NullPointerException at org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249) at org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831) at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:603) at org.hibernate.impl.SessionImpl.load(SessionImpl.java:596) at Main.main(Main.java:27)
    via by Paul Cantrell,
  • Classes that previously worked fine with Hibernate 2.1.6 are having problems with Hibernate 3.0 because they have private zero-arg constructors. If the constructors are made package-private or higher, it works fine. This may be a bug in the version of cglib distributed with Hibernate 3.0 (cglib-2.1) Example class (based on real scenario): package foo.bar; public class Foo { private Bar bar; /** for hibernate */ private Foo() { } public Foo(Bar aBar) { setBar(aBar); } public Bar getBar() { return bar; } private void setBar(Bar aBar) { bar = aBar; } } Stack trace: 18/04/2005 17:05:24 org.hibernate.proxy.CGLIBLazyInitializer getProxyFactory SEVERE: CGLIB Enhancement failed: foo.bar.Foo java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:139) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:212) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054) at foo.bar.HibernateConfigTest.testCreateSessionFactory(HibernateConfigTest.java:152) ...
    via by Robert Watkins,
  • Classes that previously worked fine with Hibernate 2.1.6 are having problems with Hibernate 3.0 because they have private zero-arg constructors. If the constructors are made package-private or higher, it works fine. This may be a bug in the version of cglib distributed with Hibernate 3.0 (cglib-2.1) Example class (based on real scenario): package foo.bar; public class Foo { private Bar bar; /** for hibernate */ private Foo() { } public Foo(Bar aBar) { setBar(aBar); } public Bar getBar() { return bar; } private void setBar(Bar aBar) { bar = aBar; } } Stack trace: 18/04/2005 17:05:24 org.hibernate.proxy.CGLIBLazyInitializer getProxyFactory SEVERE: CGLIB Enhancement failed: foo.bar.Foo java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhancer.java:682) at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:494) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:139) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:212) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054) at foo.bar.HibernateConfigTest.testCreateSessionFactory(HibernateConfigTest.java:152) ...
    via by Robert Watkins,
  • Use AOP on class with final members
    via Stack Overflow by Tomer
    ,
    • java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42) at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144) at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83) at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54) at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47) at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218) at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005) at Main.main(Main.java:10)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    6 more bugmates