DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCJPA-175
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ales Justin
Votes: 0
Watchers: 1
Operations

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

NPE in JPAEntityManagerFactory

Created: 23/May/12 02:33 PM   Updated: 18/Jun/12 10:06 AM   Resolved: 23/May/12 03:36 PM
Component/s: API
Affects Version/s: 3.0.6
Fix Version/s: 3.0.11, 3.1.0.m2


 Description  « Hide
I get NPE in JPAEntityManagerFactory, which results from overridingProps being null.


14:18:41,455 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[getFlights]] (http-/192.168.30.248:8080-1) Servlet.service() for servlet getFlights threw exception: java.lang.NullPointerException
at org.datanucleus.api.jpa.JPAEntityManagerFactory.<init>(JPAEntityManagerFactory.java:330) [datanucleus-api-jpa-3.0.6.jar:]
at org.datanucleus.api.jpa.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:91) [datanucleus-api-jpa-3.0.6.jar:]
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final.jar:1.0.1.Final]
at com.google.appengine.demos.helloorm.EMF.<clinit>(EMF.java:12) [classes:]

    public JPAEntityManagerFactory(String unitName, Map overridingProps)
315 {
316 if (unitMetaDataCache == null)
317 {
318 // Create our cache so we save on lookups
319 unitMetaDataCache = new HashMap<String, PersistenceUnitMetaData>();
320 }
321
322 // Find the "persistence-unit" with this name
323 PluginManager pluginMgr = null;
324 unitMetaData = JPAEntityManagerFactory.unitMetaDataCache.get(unitName);
325 if (unitMetaData == null)
326 {
327 // Find all "META-INF/persistence.xml" files in the current thread loader CLASSPATH and parse them
328 pluginMgr = PluginManager.createPluginManager(overridingProps, this.getClass().getClassLoader());
329 String persistenceFileName = null;
330 if (overridingProps.containsKey(PropertyNames.PROPERTY_PERSISTENCE_XML_FILENAME)) // <----------- HERE


Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 23/May/12 03:36 PM
Thx. Trap for that input param is present in branches/3.0 and trunk