-
1. Re: JBoss MBean API
peterj Aug 14, 2006 3:21 PM (in response to yizhao)The MBeanServerConnection class contains many methods that will help you find what you need. See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=84303
for some example code.
See http://java.sun.com/j2ee/1.4/docs/api/javax/management/MBeanServerConnection.html for the API. -
2. Re: JBoss MBean API
yizhao Aug 14, 2006 4:15 PM (in response to yizhao)Hi,
Thanks for that info. I didn't state my question too clearly but I was actually asking a slitly different question. For example, after I establish a connection with the JBoss AS, if I wanted to get the version number I would do the following:
ObjectName on = new ObjectName("jboss.system:type=Server");
Object ver = server.getAttribute(on, "VersionName");
System.out.println("Version " + ver);
After starting the server, from the web-console page, under "System->JMX Mbeans", there is a list of mbeans and associated attributes. I am having trouble finding the MBeans and attributes that I need. For example, JVM heap size, current heap usage, JDBCDataSourceRuntime info, ExecuteQueue info, OpenSocketsCurrentCount, SocketsOpenedTotalCount.
Thanks! -
3. Re: JBoss MBean API
peterj Aug 14, 2006 4:29 PM (in response to yizhao)Here are a few to get started with:
Data source connection pool information for datasource named XXX: jboss.jca:name=XXX,service=ManagedConnectionPool
Heap info: jboss.system:type=ServerInfo
Socket information (aka threads) for port 8080: jboss.web:name=http-0.0.0.0-8080,type=ThreadPool
By the way, it might be easier to use the jmx-console than the web console to locate and browse through the mbeans. -
4. Re: JBoss MBean API
j_mmontero Aug 17, 2006 4:11 PM (in response to yizhao)Hi yizhao,
Could you please post how you are doing the connection to the remote Jboss Server? -
5. Re: JBoss MBean API
peterj Aug 17, 2006 4:15 PM (in response to yizhao)Did you see the link to the example code in my earlier reply? That is a stand-alone client application that connects to an mbean server. Just change the "localhost" in the URL to your remote host name.
-
6. Re: JBoss MBean API
j_mmontero Aug 17, 2006 4:32 PM (in response to yizhao)Thxs Peter,
When I try to run the java program I got the following Exception
javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.jmx.adaptor.rmi.RMIAdaptor (no security manager: RMI class loader disabled)]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(Unknown Source)
at ExClient.main(ExClient.java:20)
Any Help would be appreciated! -