You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2007/11/20 23:53:43 UTC

[jira] Created: (OPENJPA-449) Under concurrent access, createEntityManager() fails with NPE.

Under concurrent access, createEntityManager() fails with NPE.
--------------------------------------------------------------

                 Key: OPENJPA-449
                 URL: https://issues.apache.org/jira/browse/OPENJPA-449
             Project: OpenJPA
          Issue Type: Bug
            Reporter: Pinaki Poddar


Under concurrent access, new Broker construction fails with NPE.
The observed scenario (when many threads are asking for new Brokers) shows the following:

 Caused by: <openjpa-0.0.0-rnull nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:1)
Caused by: java.lang.NullPointerException
	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:263)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:198)

The cause is an uninitialzed instance variable _pcClassLoaders in AbstractBrokerFactory. It is *conditionally* initialized within loadPersistentTypes() which is invoked during broker creation. Safer option is to intialize this variable on class constructor. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-449) Under concurrent access, createEntityManager() fails with NPE.

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-449.
-------------------------------------

    Resolution: Duplicate

Duplicate of OPENJPA-437

> Under concurrent access, createEntityManager() fails with NPE.
> --------------------------------------------------------------
>
>                 Key: OPENJPA-449
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-449
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Pinaki Poddar
>
> Under concurrent access, new Broker construction fails with NPE.
> The observed scenario (when many threads are asking for new Brokers) shows the following:
>  Caused by: <openjpa-0.0.0-rnull nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
> 	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:1)
> Caused by: java.lang.NullPointerException
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:263)
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:198)
> The cause is an uninitialzed instance variable _pcClassLoaders in AbstractBrokerFactory. It is *conditionally* initialized within loadPersistentTypes() which is invoked during broker creation. Safer option is to intialize this variable on class constructor. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.