问题
ENVIRONMENT NetBeans 6.9.1, GlassFish 3.1, METRO 2.1
I want to make a list of available web services, so I'm querying JMX MBeanServer for *:type=WSEndpoint,*
. The problem is, there are only ~56 Mbeans after deploy, and WSEndpoint
beans are not registered. If I connect with JMXterm, the MBean count jumps up to ~380, and all WSEndpoint
beans are visible. From JConsole, I don't see any folder
, but after running JMXterm I do.
Even if I call the web service, the MBeans stay unregistered. METRO monitoring is enabled by default, and I left it like that; after deploy a console message INFO: Metro monitoring rootname successfully set to: amx:pp=/mon/server-mon[server],type=WSEndpoint,name=...
is shown.
What does JMXterm do so that all MBeans are visible? Does it do any method calls to MBeanServer
? Is there any solution, so that I can access WSEndpoint
beans right after deploy?
回答1:
You can trigger the registration of all AMX MBeans with by executing the JMX operation bootAMX
on the MBean amx-support:type=boot-amx
.
回答2:
Meanwhile, I've found the answer in METRO Users Guide: 19.5. Notes.
The AMX mbean is created lazily. Therefore, if one deploys an endpoint in GlassFish and then looks for the Metro WSEndpoint mbeans using JConsole there are times where the AMX mbean does not appear. To activate it start up the asadmin GUI or CLI. Or use jmxterm and issue its domains command.
In some cases Metro endpoint mbeans will not appear until the endpoint receives its first client invocation.
WSClient mbeans can appear and disappear quickly if the stub is just used for one call then closed immediately. A stub that uses reliable messaging or secure conversation generally stays active longer since it will most likely be used for multiple calls.
However, after running the asadmin GUI or CLI did not help, I could only solve it by connecting to the JVM with JMXterm.
来源:https://stackoverflow.com/questions/5618820/jmx-mbeans-not-visible-after-deploy