Issue Details (XML | Word | Printable)

Key: NUCCORE-631
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Peter Rainer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

java.lang.NullPointerException - org.datanucleus.api.jdo.JDOPersistenceManagerFactory

Created: 22/Jan/11 12:44 AM   Updated: 23/Jan/11 11:57 AM   Resolved: 22/Jan/11 09:21 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.0.m1

File Attachments: 1. Zip Archive DatanucleusTest.zip (17 kB)


Datastore: HBase


 Description  « Hide
If I try to run version 3 in a J2EE application the following JPAEntityManagerFactory constructor gets called:
JPAEntityManagerFactory(PersistenceUnitInfo unitInfo, Map overridingProps)

one of the properties is "datanucleus.primaryClassLoader" - when it later on calls JDOPersistenceManagerFactory constructor in line 351 it tries to retrieve configuration (from the nucleusContext) in order to set the persistence properties, but as the nucleusContext only gets set in line 370 it fails with a NullPointerException (see stack trace below)


Exception in thread "main" javax.jdo.JDOFatalInternalException: Unexpected exception caught.
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1193)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.initialisePMF(JPAEntityManagerFactory.java:576)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:279)
at org.datanucleus.api.jpa.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:59)
at org.datanucleus.test.A.entityManager_aroundBody0(A.java:78)
at org.datanucleus.test.A.entityManager(A.java:1)
at org.datanucleus.test.A.persist(A.java:50)
at org.datanucleus.test.Main1.main(Main1.java:16)
NestedThrowablesStackTrace:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.initialisePMF(JPAEntityManagerFactory.java:576)
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:279)
at org.datanucleus.api.jpa.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:59)
at org.datanucleus.test.A.entityManager_aroundBody0(A.java:78)
at org.datanucleus.test.A.entityManager(A.java:1)
at org.datanucleus.test.A.persist(A.java:50)
at org.datanucleus.test.Main1.main(Main1.java:16)
Caused by: java.lang.NullPointerException
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getConfiguration(JDOPersistenceManagerFactory.java:659)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:351)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:272)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:199)
... 17 more

Peter Rainer added a comment - 22/Jan/11 12:45 AM
Attached please find a test application of this issue (it's a bit more complicated than the last one because I had to simulate the call like J2EE does it internally)

Peter Rainer made changes - 22/Jan/11 12:45 AM
Field Original Value New Value
Attachment DatanucleusTest.zip [ 11340 ]
Peter Rainer added a comment - 22/Jan/11 12:52 AM
apologize only realized afterwards that I should have reported it onto project DataNucleus API JPA

Andy Jefferson made changes - 22/Jan/11 09:19 AM
Project DataNucleus Store HBase [ 10240 ] DataNucleus Core [ 10143 ]
Key NUCHBASE-31 NUCCORE-631
Affects Version/s 3.0.0.release [ 11116 ]
Affects Version/s 3.0.0.m1 [ 11118 ]
Andy Jefferson added a comment - 22/Jan/11 09:21 AM
Nothing to do with JPA. Nothing to do with HBase. Simply that initialisation process is changed in 3.x, and could have easily been simulated by creating a PMF with some input properties in the call

Andy Jefferson made changes - 22/Jan/11 09:21 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.0.m1 [ 11060 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 23/Jan/11 11:57 AM
Status Resolved [ 5 ] Closed [ 6 ]