f



Remote JMX connection doesn't work

Hi

I am trying to profile an application. For some reason it ends up spending 100% CPU, and I cannot recreate this myself, so I want to profile a system in production.

I have started it with the following command:
java -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=12001 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar chatmaster.jar

That works fine, and I can telnet to it. But I tried connecting VisualVM to it by right clicking on "Remote" and selecting "Add Remote Host". Then right clicking on the new host and selected "Add JMX Connection" and passed it the port (12001).

This doesn't work however. A window pops up saying "Cannot connect using service:jmx:rmi:///jndi/rmi://10.0.1.24:12001/jmxrmi".
Using wireshark I can see that the services did in fact talk to each other.

Do you know what the problem is ?
The server is running Java 1.6.0_14 and on the client I use 1.6.0_16 and VisualVM 1.1 build 081208.

I have the following in VisualVM's log:

INFO [com.sun.tools.visualvm.jmx.JmxModelImpl]: connect(service:jmx:rmi:///jndi/rmi://10.0.1.24:12001/jmxrmi)
java.net.ConnectException: Connection refused
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:525)
	at java.net.Socket.connect(Socket.java:475)
	at java.net.Socket.<init>(Socket.java:372)
	at java.net.Socket.<init>(Socket.java:186)
	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
Caused: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
	java.net.ConnectException: Connection refused
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
	at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
	at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
	at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
	at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)
	at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:279)
	at com.sun.tools.visualvm.jmx.JmxModelImpl$ProxyClient.tryConnect(JmxModelImpl.java:625)
[catch] at com.sun.tools.visualvm.jmx.JmxModelImpl$ProxyClient.connect(JmxModelImpl.java:555)
	at com.sun.tools.visualvm.jmx.JmxModelImpl.connect(JmxModelImpl.java:233)
	at com.sun.tools.visualvm.jmx.JmxModelImpl.<init>(JmxModelImpl.java:222)
	at com.sun.tools.visualvm.jmx.JmxModelProvider.createModelFor(JmxModelProvider.java:61)
	at com.sun.tools.visualvm.jmx.JmxModelProvider.createModelFor(JmxModelProvider.java:42)
	at com.sun.tools.visualvm.core.model.ModelFactory.getModel(ModelFactory.java:111)
	at com.sun.tools.visualvm.tools.jmx.JmxModelFactory.getJmxModelFor(JmxModelFactory.java:69)
	at com.sun.tools.visualvm.jmx.application.JmxApplicationProvider.addJmxApplication(JmxApplicationProvider.java:253)
	at com.sun.tools.visualvm.jmx.application.JmxApplicationProvider.createJmxApplication(JmxApplicationProvider.java:192)
	at com.sun.tools.visualvm.jmx.JmxApplicationsSupport.createJmxApplicationImpl(JmxApplicationsSupport.java:211)
	at com.sun.tools.visualvm.jmx.JmxApplicationsSupport.createJmxApplicationInteractive(JmxApplicationsSupport.java:189)
	at com.sun.tools.visualvm.jmx.application.AddJMXConnectionAction$1.run(AddJMXConnectionAction.java:79)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

The "Connection refused to host: 127.0.0.1" really puzzles me.
Any ideas ?
0
robert141 (5)
11/11/2009 11:04:29 AM
comp.lang.java 3285 articles. 1 followers. Post Follow

0 Replies
1299 Views

Similar Articles

[PageSpeed] 1

Reply: