What port is used by Java RMI connection?

kwc picture kwc · Jun 18, 2010 · Viewed 116.4k times · Source

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.

Answer

skaffman picture skaffman · Jun 18, 2010

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.