openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] Updated: (OPENJPA-1119) NPE in InstrumentationFactory
Date Wed, 10 Jun 2009 17:23:07 GMT


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

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. 


> NPE in InstrumentationFactory
> -----------------------------
>                 Key: OPENJPA-1119
>                 URL:
>             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(
>         at org.apache.openjpa.enhance.InstrumentationFactory.access$200(
>         at org.apache.openjpa.enhance.InstrumentationFactory$
>         at Method)
>         at org.apache.openjpa.enhance.InstrumentationFactory.getInstrumentation(
>         at org.apache.openjpa.enhance.PCEnhancerAgent.loadDynamicAgent(
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.loadAgent(
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(
>         at org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(
>         at javax.persistence.Persistence.createFactory(
>         ... 51 more
> [1]

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

View raw message