Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20367

[GSS](7.3.z) HHH-14257 - NullPointerException deploying persistence unit with a map collection indexed using an Embeddable with an association to the entity which owns the map

XMLWordPrintable

      An entity is defined with a Map collection property using as index an Embeddable with an association to the owner of the Map. During construction of the entity manager factory, a NullPointerException is raised.

      ... javax.persistence.PersistenceException: [PersistenceUnit: XXX] Unable to build Hibernate SessionFactory
              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1327)
              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1253)
              at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
              ... 9 more
      Caused by: java.lang.NullPointerException
              at org.hibernate.loader.plan.build.internal.AbstractLoadPlanBuildingAssociationVisitationStrategy.foundCircularAssociation(AbstractLoadPlanBuildingAssociationVisitationStrategy.java:669)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitAttributeDefinition(MetamodelGraphWalker.java:148)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitAttributes(MetamodelGraphWalker.java:133)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitCompositeDefinition(MetamodelGraphWalker.java:209)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitCollectionIndex(MetamodelGraphWalker.java:240)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitCollectionDefinition(MetamodelGraphWalker.java:217)
              at org.hibernate.persister.walking.spi.MetamodelGraphWalker.visitCollection(MetamodelGraphWalker.java:73)
              at org.hibernate.loader.plan.build.spi.MetamodelDrivenLoadPlanBuilder.buildRootCollectionLoadPlan(MetamodelDrivenLoadPlanBuilder.java:54)
              at org.hibernate.loader.collection.plan.AbstractLoadPlanBasedCollectionInitializer.<init>(AbstractLoadPlanBasedCollectionInitializer.java:61)
              at org.hibernate.loader.collection.plan.CollectionLoader.<init>(CollectionLoader.java:81)
              at org.hibernate.loader.collection.plan.CollectionLoader$Builder.byKey(CollectionLoader.java:74)
              at org.hibernate.loader.collection.plan.AbstractBatchingCollectionInitializerBuilder.buildNonBatchingLoader(AbstractBatchingCollectionInitializerBuilder.java:28)
              at org.hibernate.loader.collection.BatchingCollectionInitializerBuilder.createBatchingOneToManyInitializer(BatchingCollectionInitializerBuilder.java:85)
              at org.hibernate.persister.collection.OneToManyPersister.createCollectionInitializer(OneToManyPersister.java:513)
              at org.hibernate.persister.collection.AbstractCollectionPersister.postInstantiate(AbstractCollectionPersister.java:668)
              at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707) [rt.jar:1.8.0_222]
              at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:233)
              at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
              at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1250)
              ...
      

              chaowan@redhat.com Chao Wang
              rhn-support-sfikes Stephen Fikes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: