Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 9538 invoked from network); 10 Jun 2009 17:36:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jun 2009 17:36:46 -0000 Received: (qmail 7225 invoked by uid 500); 10 Jun 2009 17:23:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 7209 invoked by uid 500); 10 Jun 2009 17:23:36 -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 7192 invoked by uid 99); 10 Jun 2009 17:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 17:23:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2009 17:23:27 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6D0CF234C004 for ; Wed, 10 Jun 2009 10:23:07 -0700 (PDT) Message-ID: <1284564100.1244654587432.JavaMail.jira@brutus> Date: Wed, 10 Jun 2009 10:23:07 -0700 (PDT) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-1119) NPE in InstrumentationFactory In-Reply-To: <974584374.1244145907340.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-1119: --------------------------------- Attachment: OPENJPA-1119.PATCH Refactored code for a more 'complete' fix. This new patch fixes the NPE, but also does some additional manifest validation. If it is determined that the InstrumentationFactory was loaded from a jar file, that jar file is opened up and the manifest is examined. If the InstrumentationFactory is defined as the Agent-Class, we will go ahead and use that as an argument to the attach api. If the InstrumentationFactory isn't defined as the Agent-Class, we will go off and create a temporary file. Currently the openjpa-all.xxxx.jar and openjpa-kernal.xx.jar files do not have the InstrumentationFactory defined as the Agent-Class and I will address that issue in OPENJPA-1117. I can hypothesize that the InstrumentationFactory could be loaded from a jar that doesn't have the Agent-Class defined if a user were to repackage OpenJPA and not properly copy the manifest attributes over. While testing this patch I uncovered 33 new test failures when running on Sun 1.6. After looking closer at the failures, most of the tests are named TestUnenhancedxxxxx. After looking at the commit comment for OPENJPA-293, it appears that it was known that these tests would fail when using redefinition. Now that it is possible to use redefinition, these tests are failing. Since it appears [1] that we are going to disable support for the redefinition(subclassing) I am going to exclude these failing tests from the build. Three other tests are also failing due to the dynamic enhancer, so I am excluding those tests also. I also updated the openjpa-persistence-jdbc/pom.xml and added -XX:MaxPermSize=256m to the test.jvm.arguments to take care of the Sun PermGen OOM problems that I run into when running on Sun 1.6. [1]http://n2.nabble.com/-VOTE--Turn-off-enhancement-by-subclassing-as-the-default-td1616140.html#a2950000 > NPE in InstrumentationFactory > ----------------------------- > > Key: OPENJPA-1119 > URL: https://issues.apache.org/jira/browse/OPENJPA-1119 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.0 > Reporter: Rick Curtis > Assignee: Rick Curtis > Fix For: 2.0.0 > > Attachments: OPENJPA-1119.PATCH, OPENJPA-1119.patch > > > As reported in the dev forum [1] InstrumentationFactory.class.getProtectionDomain().getCodeSource() returns null, causing a NPE. > Caused by: java.lang.NullPointerException > at org.apache.openjpa.enhance.InstrumentationFactory.getAgentJar(InstrumentationFactory.java:204) > at org.apache.openjpa.enhance.InstrumentationFactory.access$200(InstrumentationFactory.java:47) > at org.apache.openjpa.enhance.InstrumentationFactory$1.run(InstrumentationFactory.java:99) > at java.security.AccessController.doPrivileged(Native Method) > at org.apache.openjpa.enhance.InstrumentationFactory.getInstrumentation(InstrumentationFactory.java:87) > at org.apache.openjpa.enhance.PCEnhancerAgent.loadDynamicAgent(PCEnhancerAgent.java:95) > at org.apache.openjpa.persistence.PersistenceProviderImpl.loadAgent(PersistenceProviderImpl.java:243) > at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:91) > at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:119) > at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:55) > at javax.persistence.Persistence.createFactory(Persistence.java:172) > ... 51 more > [1] http://n2.nabble.com/Error-loading-agent-with-Openjpa2-td3024299.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.