openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cverdes <cver...@gmail.com>
Subject Error loading agent with Openjpa2
Date Thu, 04 Jun 2009 11:57:35 GMT

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.
-- 
View this message in context: http://n2.nabble.com/Error-loading-agent-with-Openjpa2-tp3024299p3024299.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.


Mime
View raw message