I'm getting a trouble with tomcat 6.0.26 and and openjpa 1.2.2 javaagent.
I've added javaagent path to catalina.sh:
JAVA_OPTS="$JAVA_OPTS -javaagent:/usr/share/tomcat/lib/openjpa-1.2.2.jar"
and also put commons-lang-2.3.jar into tomcat lib directory. But JVM throwed
an exeption on startup:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:343)
at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:358)
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/lang/exception/NestableRuntimeException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
at
org.apache.openjpa.enhance.PCEnhancerAgent.premain(PCEnhancerAgent.java:64)
... 6 more
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.lang.exception.NestableRuntimeException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
... 19 more
FATAL ERROR in native method: processing of -javaagent failed
Aborted
Tomcat in startup script sets the CLASSPATH variable to
"$CATALINA_HOME"/bin/bootstrap.jar, so i tried to modify it in catalina.sh
to "$CATALINA_HOME"/bin/commons-lang-2.3.jar. Now tomcat starts, but when
launching my application I'm getting more exceptions, first:
Caused by: NoClassDefFoundError: javax/persistence/spi/PersistenceProvider
I've added geronimo-jpa_3.0_spec-1.0.jar to the CLASSPATH and then I got
Caused by: java.lang.ClassNotFoundException:
javax.transaction.Synchronization
So it asks me for a bunch of libs from my WEB-INF/lib directory. And finally
JVM says it is unable to load classes from my app. So i think it is not a
right way to fix my problem) I'm hoping for your help!
P.S. I also asked this question in
http://old.nabble.com/Tomcat-and-openjpa-javaagent-ts28506406.html Tomcat
list
--
View this message in context:
http://openjpa.208410.n2.nabble.com/openjpa-javaagent-enhancement-with-tomcat-tp5029993p5029993.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.