Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Robert Garrido
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
solution:

-Djava.rmi.server.hostname=
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic