users@glassfish.java.net

Re: Enable glassfish JVM for JMX monitoring, how i can do it?

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Nov 2007 19:20:07 PST

Kedar, I created a custom agent using the technique described at
http://blogs.sun.com/jmxetc/entry/connecting_through_firewall_using_jmx. I placed my jar in C:\glassfish\domains\domain1\lib\agent.jar. I added a line to my domain.xml that looks like this:

        <jvm-options>-javaagent:C:\glassfish\domains\domain1\lib\agent.jar</jvm-options>

but I get exceptions like this when I start the domain:

Could not load Logmanager "com.sun.enterprise.server.logging.ServerLogManager"
java.lang.ClassNotFoundException: com.sun.enterprise.server.logging.ServerLogManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.util.logging.LogManager$1.run(LogManager.java:166)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.util.logging.LogManager.<clinit>(LogManager.java:156)
        at java.util.logging.Logger.getLogger(Logger.java:254)
        at sun.rmi.runtime.Log$LoggerLogFactory.createLog(Log.java:154)
        at sun.rmi.runtime.Log.getLog(Log.java:121)
        at sun.rmi.server.Util.<clinit>(Util.java:56)
        at sun.rmi.server.UnicastRef.<clinit>(UnicastRef.java:33)
        at java.rmi.server.RemoteServer.<clinit>(RemoteServer.java:97)
        at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:186)
        at com.sixth.rmi.agent.CustomAgent.premain(CustomAgent.java:78)
        at com.sixth.rmi.agent.CustomAgent.premain(CustomAgent.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        ...

I think the class that is not being found lives in glassfish\lib\appserv-rt.jar. Do you have any advice regarding how to set up my domain.xml so that the classpath is set up properly before my agent runs?
[Message sent by forum member 'tradiate' (tradiate)]

http://forums.java.net/jive/thread.jspa?messageID=244673