java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass

Hibernate JIRA | Paul Cantrell | 1 decade ago
  1. 0

    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)

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass
  2. 0

    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)

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.IllegalArgumentException: Cannot subclass final class class classesThatCauseTheBug.FinalClass
  3. 0

    Hibernate Community • View topic - Error when using private constructor

    hibernate.org | 1 year ago
    java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    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) ...

    Hibernate JIRA | 1 decade ago | Robert Watkins
    java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
  6. 0

    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) ...

    Hibernate JIRA | 1 decade ago | Robert Watkins
    java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given

    9 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Cannot subclass final class class classesThatCauseTheBug.FinalClass

      at net.sf.cglib.proxy.Enhancer.generateClass()
    2. IDEA
      Enhancer.generateClass
      1. net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:442)
      1 frame
    3. Code Generation Library
      AbstractClassGenerator.create
      1. net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
      2. net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215)
      2 frames
    4. IDEA
      Enhancer.create
      1. net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:373)
      2. net.sf.cglib.proxy.Enhancer.create(Enhancer.java:281)
      3. net.sf.cglib.proxy.Enhancer.create(Enhancer.java:640)
      3 frames
    5. Hibernate
      SingleTableEntityPersister.<init>
      1. org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:94)
      2. org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42)
      3. org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:144)
      4. org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)
      5. org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:54)
      6. org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:47)
      7. org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:218)
      8. org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
      9. org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
      9 frames
    6. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
      2. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
      2 frames
    7. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
      1 frame
    8. Unknown
      Main.main
      1. Main.main(Main.java:10)
      1 frame