Jun 6, 2013

Java - JMX through firewalls and RMI debugging hints.

Currently I'm working on JMX.

The problem with the Java JMX is, that the communication is done by RMI-Calls.

The initial port is a fixed port, but the ongoing communication over RMI
uses dynamic ports and this is a killer when you are communicating through
a firewall.

Here is a hint for an Agent-Implementation, which uses a second fixed
port for the RMI communication.

This is easier for firewalls to allow 2 ports for the communication.

The communication is done by RMI-Calls, which are "garbage" when you
trace the network traffic by wireshark, tcpdump or something else.
Some parts are readable , but not all.

Here was a hint about a system property, which can be set and after this, there are outputs in the console in my case.
The system-property is:

-Djava.rmi.server.logCalls=true

When there also is also a NAT, the RMI-Server has the wrong server in the
response to contact. Therefore an other property sets the name, which the
RMI-Calls returns as contact:
( from here )

-Djava.rmi.server.hostname=<public/NAT address>