openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: Error loading agent with Openjpa2
Date Thu, 04 Jun 2009 13:06:02 GMT
How is your project setup?
Are you using Dali and configured EA2 as a runtime or are you using Ant, 
  Maven plugin or Eclipse Plugin for OpenJPA pre-enhancement?
	http://openjpa.apache.org/enhancement-with-eclipse.html

BTW - build time enhancement is the preferred method to use and the 
runtime enhancement will be turned off by default in future builds.


-Donald


cverdes wrote:
> Hi, Im running a DAO Test (with openjpa-kernel-2.0.0-EA2-SNAPSHOT) in eclipse
> and with Maven, getting the next exception:
> 
> ...
> 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) I've downloaded the sources and fixed the problem not using the dynamic
> enhance agent (openjpa.DynamicEnhancementAgent=false), but I couldn't be
> able to find this parameter in the web, so my first question is: Where can I
> find updated reference manual or similar documentation?.
> 
> 2) I've seen that this error is because
> InstrumentationFactory.class.getProtectionDomain()== null
>                 .getCodeSource().getLocation().
> So, when it does getLocation().getFile() the NullPointerException is
> throwed. I think this is a bug, and something like (if location!=null)
> should be in the code.
> Anyway, Do you know why could be  the code source location null? I would
> like to test with dynamic enhance as well :p
> 
> Thanx a lot and I hope this thread will help in your work.

Mime
View raw message