Getting nullpointer exception while executing query

Description

Hi,

I'm trying to upgrade my application from OpenJPA implementation 1.0.1 which was using JPA 1.0 to Hibernate 5.1.2

I'm getting nullpointer exception when trying to to call geResultList on a Entity class.

My Sample classes are below: (I've changed the class names as I can not share my original source code. But the mapping are same.)

1) Class Charger (Representing a sort of mobile charger that has 2 Pin)

2)

3) every charger has 2 pins so I've declared a bi-directional one to many mapping between Charger and pin.

4) PIN Entity has 2 properties. CHARGER_ID and PIN_NUMBER. this 2 field defines one record in the PIN table uniquely. So I've declared a IDclass (ChargerPin) for representing the composite key

5) Now while I'm invoking the below query I'm getting a nullPointer exception with Empty satck trace.

Can you please look into this bug.
Earlier I was trying with Hibernate 5.1.1. version and then the code was throwing error as "Error accessing field by reflection for persistent property".
Then I changed the code base to use Hibernate version 5.1.2 and then without change of source code the exception got changed into Nullpointer exception.

Environment

Hibernate 5.1.2 running on Weblogic 12.1.2 with Java 1.6 SDK.

Activity

Show:
sagnik sarkar
November 8, 2016, 12:00 AM

Hi,

Please ignore the TestClass.java attachment. I've now added another class names "HibernateTestClass.java" and corresponding persistence XML in it.

They are the updated one.

sagnik sarkar
November 8, 2016, 12:07 AM

I've set verbose during executing the attached java class "HibernateTestClass.java" in a stand alone mode. And I'm getting the below NullPointerException along with org.hibernate.LazyInitializationException. Even though, I'm using EAGER fetching for all the collections.

[Loaded org.hibernate.engine.spi.QueryParameters from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.dialect.pagination.LimitHelper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.dialect.pagination.NoopLimitHandler from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.StatementPreparerImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.StatementPreparerImpl$QueryStatementPreparationTemplate from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.FormatStyle from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.Formatter from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.BasicFormatterImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.DDLFormatterImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.FormatStyle$NoFormatImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded oracle.jdbc.driver.Binder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.CopiedCharBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.CopiedByteBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.CopiedNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.oracore.OracleTypeCOLLECTION from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded java.sql.ParameterMetaData from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded oracle.jdbc.driver.OraclePreparedStatementReadOnly from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ByteCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarnumCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarnumBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarnumNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BooleanBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ByteBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ShortBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.LongBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.FloatBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DoubleBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BigDecimalBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.CharCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarcharCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarcharBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.VarcharNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.StringBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.SetCHARCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.SetCHARBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.LittleEndianSetCHARBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.SetCHARNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.FixedCHARCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.FixedCHARBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.FixedCHARNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DateCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DateCommonBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DateBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DateNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TimeCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TimeBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TimestampCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TimestampBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TimestampNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.DatumBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.OracleNumberBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.OracleDateBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.OracleTimestampBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSTZCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSTZBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSTZNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSLTZCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSLTZBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TSLTZNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RowidCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RowidBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.LittleEndianRowidBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RowidNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalDSCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalDSBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalDSNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalYMCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalYMBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.IntervalYMNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BfileCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BfileBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BfileNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BlobCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BlobBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BlobNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ClobCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ClobBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ClobNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RawCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RawBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RawNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.PlsqlRawCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.PlsqlRawBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryFloatBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryFloatCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryFloatNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryDoubleBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryDoubleCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BinaryDoubleNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_FLOATCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_FLOATBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_FLOATNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_DOUBLECopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_DOUBLEBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.BINARY_DOUBLENullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.LongStreamBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.LongRawStreamBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TypeCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.NamedTypeCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.TypeBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.NamedTypeBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.NamedTypeNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RefTypeCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RefTypeBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.RefTypeNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.PlsqlIbtBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.PlsqlIbtCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.PlsqlIbtNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.OutBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.ReturnParamBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.T4CRowidCopyingBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.T4CRowidBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded oracle.jdbc.driver.T4CRowidNullBinder from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded org.hibernate.engine.jdbc.spi.JdbcWrapper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.internal.WrapperOptionsImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.Loader$SqlStatementWrapper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.jdbc.internal.ResultSetReturnImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded oracle.sql.DATE from file:/C:/Project/MIO/MIO78303_77803/HibernateSupport/ojdbc14.jar]
[Loaded org.hibernate.engine.spi.EntityKey from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.type.descriptor.sql.BasicExtractor from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$2 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.pretty.MessageHelper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded sun.reflect.UnsafeObjectFieldAccessorImpl from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded org.hibernate.engine.internal.TwoPhaseLoad from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.Status from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.AbstractEntityEntry from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.MutableEntityEntry from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.EntityEntryExtraState from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.AbstractEntityEntry$EnumState from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.AbstractEntityEntry$BooleanState from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.EntityEntryContext$ManagedEntityImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.type.descriptor.sql.DateTypeDescriptor$2 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded sun.util.resources.LocaleData from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.LocaleData$1 from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.LocaleData$LocaleDataResourceBundleControl from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded java.util.ResourceBundle$SingleFormatControl from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.LocaleDataMetaInfo from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.OpenListResourceBundle from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.LocaleNamesBundle from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.CalendarData from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded sun.util.resources.CalendarData_en from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.Versioning from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.secure.spi.PermissionCheckEntityInformation from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.event.spi.PreLoadEvent from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.event.spi.PostLoadEvent from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.bytecode.enhance.spi.LazyPropertyInitializer$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.property.access.internal.PropertyAccessStrategyBackRefImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.property.access.internal.PropertyAccessStrategyBackRefImpl$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.loading.internal.LoadContexts from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.CollectionKey from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.AbstractPersistentCollection from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.PersistentBag from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.AbstractPersistentCollection$LazyInitializationWork from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.LazyInitializationException from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.AbstractPersistentCollection$DelayedOperation from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.CollectionEntry from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.internal.util.collections.IdentityMap$IdentityKey from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.type.TypeHelper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.SelfDirtinessTracker from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.AbstractPersistentCollection$4 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.event.spi.AbstractCollectionEvent from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.event.spi.InitializeCollectionEvent from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.spi.BatchFetchQueue from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader$SqlStatementWrapper from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.internal.AbstractLoadPlanBasedLoader$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.loading.internal.CollectionLoadContext from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.loading.internal.LoadingCollectionEntry from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.process.internal.ResultSetProcessingContextImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.process.spi.ResultSetProcessingContext$EntityReferenceProcessingState from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.process.internal.ResultSetProcessingContextImpl$1 from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.loader.plan.exec.process.internal.HydratedEntityRegistration from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
java.lang.NullPointerException
[Loaded org.hibernate.internal.util.collections.ConcurrentReferenceHashMap$Values from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.internal.util.collections.ConcurrentReferenceHashMap$HashIterator from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.internal.util.collections.ConcurrentReferenceHashMap$ValueIterator from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded java.util.NoSuchElementException from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded org.hibernate.engine.internal.EntityEntryContext$EntityEntryCrossRef from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.engine.internal.EntityEntryContext$EntityEntryCrossRefImpl from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.internal.util.collections.IdentityMap$IdentityMapEntry from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded java.util.IdentityHashMap$Values from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded java.util.IdentityHashMap$IdentityHashMapIterator from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]
[Loaded java.util.IdentityHashMap$ValueIterator from C:\Tools\bea\jdk160_18\jre\lib\rt.jar]

sagnik sarkar
November 8, 2016, 9:18 AM

I can see that the first LazyInitializationException is coming from the below "Loaded org.hibernate.collection.internal.AbstractPersistentCollection$DelayedOperation from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar"

*org.hibernate.collection.internal.AbstractPersistentCollection$LazyInitializationWork from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.LazyInitializationException from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
[Loaded org.hibernate.collection.internal.AbstractPersistentCollection$DelayedOperation from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]

*
And then the Nullpointer exceptionis coming from the below "org.hibernate.internal.util.collections.ConcurrentReferenceHashMap$Values from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar"

[Loaded org.hibernate.loader.plan.exec.process.internal.HydratedEntityRegistration from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]
java.lang.NullPointerException
[Loaded org.hibernate.internal.util.collections.ConcurrentReferenceHashMap$Values from file:/T:/External/hibernate/5.1.2/hibernate-core-5.1.2.Final.jar]

Chris Cranford
November 8, 2016, 4:03 PM

Your Charger class shows a collection with a target entity of type PortEntityExt5; however the collection is of type PinEntityExt5. You may want to make sure you include all entity classes that are part of your test.

Gail Badner
November 28, 2016, 9:47 PM

I think this is probably related to HHH-11209.

Assignee

Unassigned

Reporter

sagnik sarkar

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Blocker
Configure