Topic
  • 11 replies
  • Latest Post - ‏2011-06-14T14:14:13Z by MichaelCheng
SystemAdmin
SystemAdmin
462 Posts

Pinned topic JMX Connection Problem

‏2011-03-31T11:52:07Z |
Hi IBM,

I'm unable to open a JMX Connection to a other MBeanServer-Process in my Application.
I try something like ...
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://somehost:4455/somembean"));
connector.getMBeanServerConnection()

I get always a Exception like below http://the 10.12.135.4 ip is my localhost
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.12.135.4; nested exception is:
java.net.ConnectException: Connection refused: connect]

I dont know why it always try to connect to my localhost ?
The Exception occurs in the RMIConnector.findRMIServerJNDI Method.

This code works fine in WAS 6.1 and WAS 7.0.

Can anybody give me some hints ?

thanks
claus
Updated on 2011-06-14T14:14:13Z at 2011-06-14T14:14:13Z by MichaelCheng
  • RohitK
    RohitK
    38 Posts

    Re: JMX Connection Problem

    ‏2011-03-31T16:29:02Z  
    I would suggest checking if you are using the right port number by going to the WAS admin console ports panel
    click on Servers > Server Types > WebSphere application servers > server_name > Ports > port_name

    --Thanks,
    Rohit
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-04-01T05:13:36Z  
    • RohitK
    • ‏2011-03-31T16:29:02Z
    I would suggest checking if you are using the right port number by going to the WAS admin console ports panel
    click on Servers > Server Types > WebSphere application servers > server_name > Ports > port_name

    --Thanks,
    Rohit
    I do not like to connect to a WebSphere Server JMX Port.
    The MBean Server runs under a normal Java Process on a remote machine with java 1.6

    greets
    claus
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-04-01T05:17:53Z  
    I do not like to connect to a WebSphere Server JMX Port.
    The MBean Server runs under a normal Java Process on a remote machine with java 1.6

    greets
    claus
    As described before the JMXURL points to a remote host (service:jmx:rmi:///jndi/rmi://somehost:4455/somembean)
    not to my local machine !

    It looks like that the InitialContext in the RMIConnector performs a lookup to my local machine ?

    greets
    claus
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-04-04T13:19:46Z  
    Can anybody from IBM test this please ?

    thanks
    claus
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-04-13T09:54:20Z  
    Ok one more try to get help with my Problem :-)

    I have a standalone Java Program running on a different machine http://lets say this machine has following IP 10.12.135.1 as the WAS is running and under Java 1.6 with a Code like this...
    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    LocateRegistry.createRegistry(4455);
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.12.135.1:4455/csbjmxserver");
    JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mBeanServer);
    cs.start();

    In this MBeanServer some MBeans are registered ...



    On the other side i try to connect to this MBeanServer to invoke some MBeans within my Application running on WAS 8 (this machine has the IP 10.12.135.2).

    javax.management.remote.JMXConnector connector = JMXConnectorFactory.connect("service:jmx:rmi:///jndi/rmi://10.12.135.1:4455/csbjmxserver")
    MBeanServerConnection mBeanServerConnection = connector.getMBeanServerConnection();

    And described above i get always a Exception:
    javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.12.135.2;

    The 10.12.135.2 is the WAS itself and not the given JMX URL and i don't know why it tries to connect to it ?

    This code was running fine on WAS 7.0 !

    Please can somebody look at it or could test it ?

    Thanks in advice
    claus
  • DanPeretz
    DanPeretz
    1 Post

    Re: JMX Connection Problem

    ‏2011-06-02T12:43:33Z  
    Ok one more try to get help with my Problem :-)

    I have a standalone Java Program running on a different machine http://lets say this machine has following IP 10.12.135.1 as the WAS is running and under Java 1.6 with a Code like this...
    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    LocateRegistry.createRegistry(4455);
    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.12.135.1:4455/csbjmxserver");
    JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mBeanServer);
    cs.start();

    In this MBeanServer some MBeans are registered ...



    On the other side i try to connect to this MBeanServer to invoke some MBeans within my Application running on WAS 8 (this machine has the IP 10.12.135.2).

    javax.management.remote.JMXConnector connector = JMXConnectorFactory.connect("service:jmx:rmi:///jndi/rmi://10.12.135.1:4455/csbjmxserver")
    MBeanServerConnection mBeanServerConnection = connector.getMBeanServerConnection();

    And described above i get always a Exception:
    javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 10.12.135.2;

    The 10.12.135.2 is the WAS itself and not the given JMX URL and i don't know why it tries to connect to it ?

    This code was running fine on WAS 7.0 !

    Please can somebody look at it or could test it ?

    Thanks in advice
    claus
    Hi all,
    I encountered the same problem. Can anyone assist?

    Thanks,
    Dan
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-06-06T06:22:07Z  
    • DanPeretz
    • ‏2011-06-02T12:43:33Z
    Hi all,
    I encountered the same problem. Can anyone assist?

    Thanks,
    Dan
    Is there anybody from IBM, who can have a look at this please ??

    thanks
    claus
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-06-06T15:28:07Z  
    Is there anybody from IBM, who can have a look at this please ??

    thanks
    claus
    HI Claus and Dan,

    I have asked the right person to take a look. Stay tuned.

    ----
    Soloman Barghouthi,
    WebSphere Application Server Release Architect.
  • MichaelCheng
    MichaelCheng
    10 Posts

    Re: JMX Connection Problem

    ‏2011-06-09T13:48:51Z  
    HI Claus and Dan,

    I have asked the right person to take a look. Stay tuned.

    ----
    Soloman Barghouthi,
    WebSphere Application Server Release Architect.
    I was able to reproduce the issue even when the server and client are on the same machine. I have opened an internal defect. Note that it's too late to get it fixed for the June eGA. We'll have to target it for the service stream.

    Here are the scenarios I've tried:
    • Standalone client in J2SE JVM using WebSphere V7 SDK: passed
    • Client from a WebSphere V7 application server: passed
    • Standalone client in J2SE JVM using WebSphere V8 SDK: passed
    • Client from a WebSphere V8 application server: failed
  • SystemAdmin
    SystemAdmin
    462 Posts

    Re: JMX Connection Problem

    ‏2011-06-09T13:58:19Z  
    I was able to reproduce the issue even when the server and client are on the same machine. I have opened an internal defect. Note that it's too late to get it fixed for the June eGA. We'll have to target it for the service stream.

    Here are the scenarios I've tried:
    • Standalone client in J2SE JVM using WebSphere V7 SDK: passed
    • Client from a WebSphere V7 application server: passed
    • Standalone client in J2SE JVM using WebSphere V8 SDK: passed
    • Client from a WebSphere V8 application server: failed
    Hi Michael,

    Thank you for testing and opening the internal defect.
    Maybe you can point us to the APAR or post a link to the Fix that we can hopefully download a fix before the official IntermFix will
    be released.

    thanks for helping
    claus
  • MichaelCheng
    MichaelCheng
    10 Posts

    Re: JMX Connection Problem

    ‏2011-06-14T14:14:13Z  
    Hi Michael,

    Thank you for testing and opening the internal defect.
    Maybe you can point us to the APAR or post a link to the Fix that we can hopefully download a fix before the official IntermFix will
    be released.

    thanks for helping
    claus
    Hi Claus,

    I'll reply with the links when ready. thanks,