Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What port is used by Java RMI connection?

May I know what port is used by Java RMI connection?

If I want to connect a Java client application to a Java server application using RMI connection, what port I need to open at the server machine so that the client application can connect to it?

I want to set up a firewall in the server machine but I don't know which port I should open.

like image 547
kwc Avatar asked Jun 18 '10 16:06

kwc


People also ask

What port does Java RMI use?

java.rmi.activation.port This property is used to set the TCP port number on which this VM should communicate with rmid (by default, rmid listens on port 1098, but can be set to listen on a different port by using the -port option on the rmid command line).

Where is my RMI port?

The RMI services use certain default ports. The default ports are left open on the firewall on cluster nodes and remote collector nodes. Note: Ports 3091 to 3094 ports are opened in firewall by vRealize Operations for Horizon.

Does Java RMI use TCP or UDP?

Actually, it uses UDP, despite the docs claiming it's TCP.

Does Java RMI use TCP?

On top of the TCP/IP layer, RMI uses a wire-level protocol called Java Remote Method Protocol (JRMP), which works like this: Objects that require remote behavior should extend the RemoteObject class, typically through the UnicastRemoteObject subclass.


1 Answers

RMI generally won't work over a firewall, since it uses unpredictable ports (it starts off on 1099, and then runs off with a random port after that).

In these situations, you generally need to resort to tunnelling RMI over HTTP, which is described well here.

like image 69
skaffman Avatar answered Sep 21 '22 12:09

skaffman