On Jul 28, 2010, at 5:44 AM, Henri Gomez wrote:
>> You might be able to pass it via the JAVA_OPTS variable. Basically the goal
>> is to copy the openejb-javaagent-3.x.x.jar into the tomcat.home/lib/
>> directory and make sure this java option is getting passed to the jvm:
>>
>> -javaagent:$CATALINA_HOME/lib/openejb-javaagent-3.x.x.jar
>>
>> When the agent is specified on the java command line it won't try and attach
>> itself dynamically, which should prevent that error message you were seeing.
>
> I take a look at my Linux box and see nothing about -javaagent in
> startup script or openejb-javaagent-3.1.jar in tomcat6/lib/
Right, that's the part we need to add. At least for the box that encountered
the dynamic attach error.
>
> openejb-javaagent-3.1.jar is present under
> tomcat6/webapps/openejb/lib/openejb-javaagent-3.1.jar
>
> The installation on the Linux box is exactly the same that on Snow but works:
>
> Here is my JAVA_OPTS :
>
> JAVA_OPTS="-Xms256m -Xmx256m -Dcom.sun.management.jmxremote.port=19952
> -Dcom.sun.management.jmxremote=true
> -Dcom.sun.management.jmxremote.authenticate=false
> -Dcom.sun.management.jmxremote.ssl=false -Duser.language=fr
> -Djava.awt.headless=true"
>
>> From what you say, I didn't understand how it could works on Linux...
Dynamically adding a javaagent should work in java 1.6 and clearly the linux
jmv supports it just fine. Seems like a VM bug in the Snow Leopard box
("MacosxAttachProvider" "MacosxVirtualMachine")
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to
open socket file: target process not responding or HotSpot VM not
loaded
at
sun.tools.attach.MacosxVirtualMachine.<init>(MacosxVirtualMachine.java:82)
at
sun.tools.attach.MacosxAttachProvider.attachVirtualMachine(MacosxAttachProvider.java:34)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:195)
Only way to workaround this is to do it the java 1.5 way of specifying the
javaagent statically on the command line. The openejb installer webapp will do
that setup for the static approach, but you can also do it by hand as described
above.
-David