Sai Krish created AS7-5885:
------------------------------
Summary: Hibernate NullPointerException while having a MappedSuperclass with
@version attribute
Key: AS7-5885
URL:
https://issues.jboss.org/browse/AS7-5885
Project: Application Server 7
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 7.1.1.Final
Environment: Cent O.S. 6.2, JDK1.7.0_05
Reporter: Sai Krish
Assignee: Scott Marlow
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