wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes JMX cannot get connected, Maybe due wrong stub??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "JMX cannot get connected, Maybe due wrong stub???" Watch "JMX cannot get connected, Maybe due wrong stub???" New topic
Author

JMX cannot get connected, Maybe due wrong stub???

Robert Garrido
Ranch Hand

Joined: Dec 11, 2008
Posts: 30
Hi all,

I know that JMX connections issues are kind of common, however my problem is a bit more complex.

My JMX client gets binded to the remote JMX server, I can see this trace taken with tcpdump:
10.0.0.1 10.0.0.2 RMI JRMI, Version: 2, StreamProtocol

When the client invokes a object, it looks like this:
10.0.0.1 10.0.0.2 RMI JRMI, Call

The remote server responses:
10.0.0.1 10.0.0.2 RMI JRMI, ReturnData
Java Serialization
PV^PV-E?@@I
3H|^N.
npTQwSI*'jsr.javax.management.remote.rmi.RMIServerImpl_Stubpxrjava.rmi.server.RemoteStubepxrjava.rmi.server.RemoteObjectaa3pxpw2
UnicastRef127.0.0.1nW _SI*'x

So, we can see that the communication is established, but the JMX client throws this exception:
java.net.ConnectException: Connection refused
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(Unknown Source)


So, it seems the server answers, but IMO seems like the stub it returns is wrong, it has 127.0.0.1, Why is not responding the remote server address?
or
Maybe the server responses with the right stub, an stub that the client should allocate locally, but then the client cannot invoke the local stub in 127.0.0.1.

The client runs with this vm options (a Tomcat hosted webapp):
-server
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=13197


These are the server's vmoptions (another Tomcat hosted webapp):
-server
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=13199


Any ideas?
Thanks in advanced.





Robert Garrido
Ranch Hand

Joined: Dec 11, 2008
Posts: 30
solution:

-Djava.rmi.server.hostname=
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JMX cannot get connected, Maybe due wrong stub???
 
Similar Threads
JBoss JMX client
tomcat 6.0.16 JConsole problem
jconsole to weblogic using t3s
Tomcat monitoring
Activating JMX for tomcat 5.5.9 on As/400 iseries