users@glassfish.java.net

Reading AMX beans after Glassfish restart

From: <glassfish_at_javadesktop.org>
Date: Thu, 03 Jun 2010 08:47:28 PDT

I'm accessing the jdbc resources in Glassfish via the AMX JMX beans, but I've having problems on a Glassfish restart
If my war is deployed, and Glassfish is restarted, the war fails to deploy on the Glassfish restart - this is due to the bean amx:pp=/domain,type=resources not being present.
The AMX service is only started if its required (eg if the admin console is loaded)
I've tried manually starting the AMX service from my war:
I've tried calling the method new AMXGlassfish(AMXGlassfish.DEFAULT_JMX_DOMAIN).bootAMX() from my war, but on restarting glassfish, the call to bootAMX() hangs indefinitely
I've also tried connecting to the AMX JMX bean with the URL service:jmx:rmi://<local host>:8686/jndi/rmi://<local host>:8686/jmxrmi
This works if I'm deploying after Glassfish has been started, and the admin console hasn't been loaded.
If the war is deployed, and Glassfish is restarted, this fails as Glassfish cannot connect to the RMI JMX service.
From looking at glassfish logs, the start up sequence seems to be that Glassfish does not launch JMX until after all existing war files have been deployed.
Version of glassfish: v3
[Message sent by forum member 'snobbles1']

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