From dev-return-6859-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Nov 20 22:54:06 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 17061 invoked from network); 20 Nov 2007 22:54:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2007 22:54:06 -0000 Received: (qmail 86102 invoked by uid 500); 20 Nov 2007 22:53:52 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 85951 invoked by uid 500); 20 Nov 2007 22:53:52 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 85941 invoked by uid 99); 20 Nov 2007 22:53:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 14:53:52 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 22:53:49 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 06B0571420B for ; Tue, 20 Nov 2007 14:53:43 -0800 (PST) Message-ID: <8119536.1195599223008.JavaMail.jira@brutus> Date: Tue, 20 Nov 2007 14:53:43 -0800 (PST) From: "Pinaki Poddar (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-449) Under concurrent access, createEntityManager() fails with NPE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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: 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.