You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Thomas Darimont <to...@tutorials.de> on 2006/05/10 14:53:24 UTC

Access Geronimos JMX System with JConsole

Hello,

I'm was able to access the JMX Subsystem of Websphere Application Server 
Community Edition 1.0.1.1(which ist build on top of geronimo) using the 
following code:

package de.tutorials;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

/**
  * @author Tom
  */
public class JMXWebsphereInspector {

     /**
      * @param args
      */
     public static void main(String[] args) throws Exception {
         Map env = new HashMap();
         String[] credentials = new String[] { "system", "manager" }; 
//default
         env.put("jmx.remote.credentials", credentials);

         MBeanServerConnection connection = JMXConnectorFactory
                 .connect(
                         new JMXServiceURL(
 
"service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"),
                         env)
                 .getMBeanServerConnection();

         System.out.println(Arrays.toString(connection.getDomains()));
     }
}

However, if I try to access the JMX Subsystem using JConsole I can 
connect but I don't see any MBeans.

The client runs on Sun JDK 1.5.0_05 and the Server runs on IBMs
JDK 1.4.2

My settings
URL: service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector
Username: system
password: manager

On the console I can see the following Error Message:

  C:\Documents and Settings\Tom>jconsole
Error when synchronizing with MBeanServer : 
javax.management.InstanceNotFoundException: 
JMImplementation:type=MBeanServerDelegate

I looked at the mx4j and learned that the mx4j.server.MX4JMBeanServer 
registers itself using
new ObjectName("JMImplementation", "type", "MBeanServerDelegate"); in 
the Ctor. So the instance should be there...

Any hints?

Kind regards,
Thomas


Re: Access Geronimos JMX System with JConsole

Posted by Matt Hogstrom <ma...@hogstrom.org>.
WebSphere Community Edition builds on Geronimo but we don't have control over that.  I'd check out 
the WebSphere CE site since its an IBM product.  Sorry we don't have more definitive information.

Thomas Darimont wrote:
> Hello,
> 
> David Jencks wrote:
>>
>> On May 10, 2006, at 8:29 AM, Guillaume Nodet wrote:
>>
>>> I do not think there is any way to connect with JConsole.
>>> However, you should try mx4j, it should work.
>>> The main reason for the missing mbean, is that the MBean server  
>>> exposed by the jmx connector is not the real one, but a wrapper on  
>>> top of Geronimo GBean kernel.
>>>
>>
>> This is fixed in 1.1 and Dain reports that he can connect and see  
>> both gbeans-wrapped-as-mbeans and mbeans (e.g. from tomcat) in JConsole.
> 
> Cool stuff :) Will there be a Websphere Community Edition build on top 
> of geronimo 1.1?
> 
>> thanks
>> david jencks
> 
> Kind regards,
> Thomas
> 
> 
> 
> 

Re: Access Geronimos JMX System with JConsole

Posted by Thomas Darimont <to...@tutorials.de>.
Hello,

David Jencks wrote:
> 
> On May 10, 2006, at 8:29 AM, Guillaume Nodet wrote:
> 
>> I do not think there is any way to connect with JConsole.
>> However, you should try mx4j, it should work.
>> The main reason for the missing mbean, is that the MBean server  
>> exposed by the jmx connector is not the real one, but a wrapper on  
>> top of Geronimo GBean kernel.
>>
> 
> This is fixed in 1.1 and Dain reports that he can connect and see  both 
> gbeans-wrapped-as-mbeans and mbeans (e.g. from tomcat) in JConsole.

Cool stuff :) Will there be a Websphere Community Edition build on top 
of geronimo 1.1?

> thanks
> david jencks

Kind regards,
Thomas


Re: Access Geronimos JMX System with JConsole

Posted by David Jencks <da...@yahoo.com>.
On May 10, 2006, at 8:29 AM, Guillaume Nodet wrote:

> I do not think there is any way to connect with JConsole.
> However, you should try mx4j, it should work.
> The main reason for the missing mbean, is that the MBean server  
> exposed by the jmx connector is not the real one, but a wrapper on  
> top of Geronimo GBean kernel.
>

This is fixed in 1.1 and Dain reports that he can connect and see  
both gbeans-wrapped-as-mbeans and mbeans (e.g. from tomcat) in JConsole.

thanks
david jencks
> Cheers,
> Guillaume Nodet
>
> Thomas Darimont wrote:
>
>> Hello,
>>
>> I'm was able to access the JMX Subsystem of Websphere Application  
>> Server Community Edition 1.0.1.1(which ist build on top of  
>> geronimo) using the following code:
>>
>> package de.tutorials;
>>
>> import java.util.Arrays;
>> import java.util.HashMap;
>> import java.util.Map;
>>
>> import javax.management.MBeanServerConnection;
>> import javax.management.remote.JMXConnectorFactory;
>> import javax.management.remote.JMXServiceURL;
>>
>> /**
>>  * @author Tom
>>  */
>> public class JMXWebsphereInspector {
>>
>>     /**
>>      * @param args
>>      */
>>     public static void main(String[] args) throws Exception {
>>         Map env = new HashMap();
>>         String[] credentials = new String[] { "system",  
>> "manager" }; //default
>>         env.put("jmx.remote.credentials", credentials);
>>
>>         MBeanServerConnection connection = JMXConnectorFactory
>>                 .connect(
>>                         new JMXServiceURL(
>>
>> "service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"),
>>                         env)
>>                 .getMBeanServerConnection();
>>
>>         System.out.println(Arrays.toString(connection.getDomains()));
>>     }
>> }
>>
>> However, if I try to access the JMX Subsystem using JConsole I can  
>> connect but I don't see any MBeans.
>>
>> The client runs on Sun JDK 1.5.0_05 and the Server runs on IBMs
>> JDK 1.4.2
>>
>> My settings
>> URL: service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector
>> Username: system
>> password: manager
>>
>> On the console I can see the following Error Message:
>>
>>  C:\Documents and Settings\Tom>jconsole
>> Error when synchronizing with MBeanServer :  
>> javax.management.InstanceNotFoundException:  
>> JMImplementation:type=MBeanServerDelegate
>>
>> I looked at the mx4j and learned that the  
>> mx4j.server.MX4JMBeanServer registers itself using
>> new ObjectName("JMImplementation", "type", "MBeanServerDelegate");  
>> in the Ctor. So the instance should be there...
>>
>> Any hints?
>>
>> Kind regards,
>> Thomas
>>
>>
>>


Re: Access Geronimos JMX System with JConsole

Posted by Guillaume Nodet <gu...@worldonline.fr>.
I do not think there is any way to connect with JConsole.
However, you should try mx4j, it should work.
The main reason for the missing mbean, is that the MBean server exposed 
by the jmx connector is not the real one, but a wrapper on top of 
Geronimo GBean kernel.

Cheers,
Guillaume Nodet

Thomas Darimont wrote:

> Hello,
>
> I'm was able to access the JMX Subsystem of Websphere Application 
> Server Community Edition 1.0.1.1(which ist build on top of geronimo) 
> using the following code:
>
> package de.tutorials;
>
> import java.util.Arrays;
> import java.util.HashMap;
> import java.util.Map;
>
> import javax.management.MBeanServerConnection;
> import javax.management.remote.JMXConnectorFactory;
> import javax.management.remote.JMXServiceURL;
>
> /**
>  * @author Tom
>  */
> public class JMXWebsphereInspector {
>
>     /**
>      * @param args
>      */
>     public static void main(String[] args) throws Exception {
>         Map env = new HashMap();
>         String[] credentials = new String[] { "system", "manager" }; 
> //default
>         env.put("jmx.remote.credentials", credentials);
>
>         MBeanServerConnection connection = JMXConnectorFactory
>                 .connect(
>                         new JMXServiceURL(
>
> "service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"),
>                         env)
>                 .getMBeanServerConnection();
>
>         System.out.println(Arrays.toString(connection.getDomains()));
>     }
> }
>
> However, if I try to access the JMX Subsystem using JConsole I can 
> connect but I don't see any MBeans.
>
> The client runs on Sun JDK 1.5.0_05 and the Server runs on IBMs
> JDK 1.4.2
>
> My settings
> URL: service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector
> Username: system
> password: manager
>
> On the console I can see the following Error Message:
>
>  C:\Documents and Settings\Tom>jconsole
> Error when synchronizing with MBeanServer : 
> javax.management.InstanceNotFoundException: 
> JMImplementation:type=MBeanServerDelegate
>
> I looked at the mx4j and learned that the mx4j.server.MX4JMBeanServer 
> registers itself using
> new ObjectName("JMImplementation", "type", "MBeanServerDelegate"); in 
> the Ctor. So the instance should be there...
>
> Any hints?
>
> Kind regards,
> Thomas
>
>
>

Re: Access Geronimos JMX System with JConsole

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
I know Dain did some work to make sure JConsole can connect to
Geronimo 1.1.  I'm not sure whether things were broken in 1.0 (that's
what WAS CE is based on) or whether 1.0 should work and the stuff he
fixed was something we broke only during the 1.1 development process. 
Dain, can you jump in?

Thanks,
    Aaron

On 5/10/06, Thomas Darimont <to...@tutorials.de> wrote:
> Hello,
>
> I'm was able to access the JMX Subsystem of Websphere Application Server
> Community Edition 1.0.1.1(which ist build on top of geronimo) using the
> following code:
>
> package de.tutorials;
>
> import java.util.Arrays;
> import java.util.HashMap;
> import java.util.Map;
>
> import javax.management.MBeanServerConnection;
> import javax.management.remote.JMXConnectorFactory;
> import javax.management.remote.JMXServiceURL;
>
> /**
>   * @author Tom
>   */
> public class JMXWebsphereInspector {
>
>      /**
>       * @param args
>       */
>      public static void main(String[] args) throws Exception {
>          Map env = new HashMap();
>          String[] credentials = new String[] { "system", "manager" };
> //default
>          env.put("jmx.remote.credentials", credentials);
>
>          MBeanServerConnection connection = JMXConnectorFactory
>                  .connect(
>                          new JMXServiceURL(
>
> "service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector"),
>                          env)
>                  .getMBeanServerConnection();
>
>          System.out.println(Arrays.toString(connection.getDomains()));
>      }
> }
>
> However, if I try to access the JMX Subsystem using JConsole I can
> connect but I don't see any MBeans.
>
> The client runs on Sun JDK 1.5.0_05 and the Server runs on IBMs
> JDK 1.4.2
>
> My settings
> URL: service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector
> Username: system
> password: manager
>
> On the console I can see the following Error Message:
>
>   C:\Documents and Settings\Tom>jconsole
> Error when synchronizing with MBeanServer :
> javax.management.InstanceNotFoundException:
> JMImplementation:type=MBeanServerDelegate
>
> I looked at the mx4j and learned that the mx4j.server.MX4JMBeanServer
> registers itself using
> new ObjectName("JMImplementation", "type", "MBeanServerDelegate"); in
> the Ctor. So the instance should be there...
>
> Any hints?
>
> Kind regards,
> Thomas
>
>