I had to give up trying to get the javaagent to run on Eclipse Tomcat plugin.
Maybe it works, maybe it doesn't, I can't really tell at tomcat startup and the
problem is that every time I make a request, I see ClassNotFound errors.
I think the ClassNotFound errors arise from the requirement to have OpenJPA.jar
in the classpath for the server rather than the app. Ditto for the other jars
that OpenJPA depends on.
So I figure it is a class loading issue with the classes loaded by javaagent
then becoming inaccessible to the webapp.
Pure speculation though.
Adam
Adam Hardy on 07/12/09 19:24, wrote:
I'm using the Eclipse Galileo and WTP to run an embedded instance of
tomcat in Eclipse and I am trying to run enhancement on my webapp's
entities using any means possible but am having no luck so far.
The furthest I get is with the javaagent as a parameter on the tomcat
launch config. However this fails when I try to specify the
persistence.xml file. I tried:
-javaagent:/disk2/java/m2-repo/org/apache/openjpa/openjpa/1.2.2-SNAPSHOT/openjpa-1.2.2-SNAPSHOT.jar=properties=persistence.xml#OpenJpaJdbc
and I get this:
by: java.util.MissingResourceException: persistence.xml#OpenJpaJdbc
at
org.apache.openjpa.lib.conf.ProductDerivations.load(ProductDerivations.java:272)
at
org.apache.openjpa.lib.conf.Configurations.populateConfiguration(Configurations.java:344)
at
org.apache.openjpa.enhance.PCEnhancerAgent.registerClassLoadEnhancer(PCEnhancerAgent.java:101)
at
org.apache.openjpa.enhance.PCEnhancerAgent.premain(PCEnhancerAgent.java:82)
... 6 more
The line works fine when I'm using it as a parameter to run junit tests,
but not here.
I can see that Eclipse-Tomcat has put the persistence.xml file deep in
its directory structure somewhere, but giving the full path as a
parameter didn't help anyway, it should be picked up from the classpath,
I assume.
Does anyone have this working?