cverdes- Please go ahead and open up a JIRA for the NPE. This is a new code that was added a late last week. I'm still looking into why ProtectionDomain.getCodeSource() can sometimes return null(The javadoc just states that it is possible, but doesn't give any reasons). In all of my testing it always worked correctly. What JVM are you running on?
Also, the user manual [1] was updated for this support. Please let us know if any of this is unclear. -Rick [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_enhance_dynamic 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. > -- View this message in context: http://n2.nabble.com/Error-loading-agent-with-Openjpa2-tp3024299p3024791.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.
