[
https://issues.jboss.org/browse/WFLY-946?page=com.atlassian.jira.plugin.s...
]
Scott Marlow commented on WFLY-946:
-----------------------------------
We upgraded to Hibernate 4.3.0.x recently. Can you try to reproduce the NPE using the
WildFly 8 nightly build? The link is [
https://community.jboss.org/thread/224262].
If you can reproduce, can you create a
https://hibernate.onjira.com/browse/HHH jira for
Hibernate. We can then link WFLY-946 to the new HHH issue and close WFLY-946 as a
duplicate.
Hibernate NullPointerException while having a MappedSuperclass with
@version attribute
--------------------------------------------------------------------------------------
Key: WFLY-946
URL:
https://issues.jboss.org/browse/WFLY-946
Project: WildFly
Issue Type: Bug
Components: JPA / Hibernate
Environment: Cent O.S. 6.2, JDK1.7.0_05
Reporter: Sai Krish
Assignee: Scott Marlow
Original Estimate: 1 hour
Remaining Estimate: 1 hour
I am planning to have all the Entities in my project extend the common attribute from a
BaseEntity. Currently I have only one field named Version in the base entity. I have
marked the BaseEntity with the annotation of @MappedSuperclass as per the JPA standard.
Everything works fine when I have only one Extended class (say Customer). But when I
included an additional extended class, the EJB application's deployment failed with a
NullPointerException. Stack trace for the same is given below
org.jboss.msc.service.StartException in service
jboss.persistenceunit."Test.jar#primary": Failed to start service
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0_05]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0_05]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.lang.NullPointerException
at
org.hibernate.ejb.metamodel.AttributeFactory$6.resolveMember(AttributeFactory.java:947)
at
org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:423)
at
org.hibernate.ejb.metamodel.AttributeFactory.buildVersionAttribute(AttributeFactory.java:153)
at
org.hibernate.ejb.metamodel.MetadataContext.applyVersionAttribute(MetadataContext.java:301)
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:206)
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:64)
at
org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:91)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at
org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
I could not find any workarounds for it. I have attached the sample code that can be used
to reproduce the issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira