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"));
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 ?
This topic has been locked.
11 replies Latest Post - 2011-06-14T14:14:13Z by MichaelCheng
Pinned topic JMX Connection Problem
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-06-14T14:14:13Z at 2011-06-14T14:14:13Z by MichaelCheng
RohitK 110000MP6H38 PostsACCEPTED ANSWER
Re: JMX Connection Problem2011-03-31T16:29:02Z in response to SystemAdminI 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
Re: JMX Connection Problem2011-04-01T05:17:53Z in response to SystemAdminAs 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 ?
Re: JMX Connection Problem2011-04-13T09:54:20Z in response to SystemAdminOk 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();
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://10.12.135.1:4455/csbjmxserver");
JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(url, null, mBeanServer);
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
DanPeretz 270003ARSF1 Post
MichaelCheng 010000350F10 PostsACCEPTED ANSWER
Re: JMX Connection Problem2011-06-09T13:48:51Z in response to SystemAdminI 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
Re: JMX Connection Problem2011-06-09T13:58:19Z in response to MichaelChengHi 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
thanks for helping