java.lang.NullPointerException

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.NullPointerException
  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.NullPointerException
  3. 0

    Hibernate cannot proxy final classes, or classes with private null constructors. Proxying is enabled by default in Hibernate 3. The result of this is that an innocent attempt to map a class of this kind generates an error -- which is expected behavior. However, the error Hibernate generates is supremely unhelpful, and looks for all the world like a bug in Hibernate: 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) (See HHH-685 for code to reproduce this stack trace.) At least six Hibernate users (including me) thought this was a bug, and voted for it as HHH-471. There are two much more reasonable behaviors Hibernate could have: (1) Disable proxying for the class, and issue a warning: WARN: com.whatever.FinalClass is declared final; proxying is disabled ...OR... (2) Issue a meaningful error message instead of the NPE: HibernateMappingException: com.whatever.FinalClass is declared final; disable proxies for this object using lazy="false"

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate cannot proxy final classes, or classes with private null constructors. Proxying is enabled by default in Hibernate 3. The result of this is that an innocent attempt to map a class of this kind generates an error -- which is expected behavior. However, the error Hibernate generates is supremely unhelpful, and looks for all the world like a bug in Hibernate: 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) (See HHH-685 for code to reproduce this stack trace.) At least six Hibernate users (including me) thought this was a bug, and voted for it as HHH-471. There are two much more reasonable behaviors Hibernate could have: (1) Disable proxying for the class, and issue a warning: WARN: com.whatever.FinalClass is declared final; proxying is disabled ...OR... (2) Issue a meaningful error message instead of the NPE: HibernateMappingException: com.whatever.FinalClass is declared final; disable proxies for this object using lazy="false"

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.NullPointerException

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

      No message provided

      at org.hibernate.tuple.AbstractTuplizer.createProxy()
    2. Hibernate
      BasicEntityPersister.createProxy
      1. org.hibernate.tuple.AbstractTuplizer.createProxy(AbstractTuplizer.java:249)
      2. org.hibernate.persister.entity.BasicEntityPersister.createProxy(BasicEntityPersister.java:2831)
      2 frames
    3. Hibernate
      SessionImpl.load
      1. org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:218)
      2. org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:163)
      3. org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
      4. org.hibernate.impl.SessionImpl.load(SessionImpl.java:603)
      5. org.hibernate.impl.SessionImpl.load(SessionImpl.java:596)
      5 frames
    4. Unknown
      Main.main
      1. Main.main(Main.java:27)
      1 frame