Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use RMI with applet client behind a firewall?

How can I use RMI with a applet client behind a firewall?

How can I use RMI with a firewalled server and firewalled applet client? (If possible)

I know that the RMI server uses port 1099 (by default, but this is configurable); however after this the communication requires a new socket on a different random port. I also know that you can set the proxy on the client for RMI over HTTP tunneling which in theory should solve my issue. But I can't make it work (I tried setting the environmental properties on my XP client, but Internet Explorer keeps ignoring them).

like image 221
michelemarcon Avatar asked Jan 22 '09 14:01

michelemarcon


People also ask

What port does RMI use?

By default, the RMI Registry uses port 1099. By default, RMI remote objects use a random system-allocated port, unless a fixed port has been specified when exporting a remote object.

What is RMI explain with suitable example?

RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one system (JVM) to access/invoke an object running on another JVM. RMI is used to build distributed applications; it provides remote communication between Java programs. It is provided in the package java.

What is proxy in RMI?

A proxy object is an object on one "side" of an RMI connection which represents an object which really exists on the other side. When an RMI::Client calls a method on its associated RMI::Server, and that method returns a reference of any kind, a proxy is made on the client side, rather than a copy.


2 Answers

See http://java.sun.com/javase/6/docs/technotes/guides/rmi/faq.html#firewall

like image 101
iny Avatar answered Oct 05 '22 11:10

iny


If the servers code is in your hand you could also restrict RMI to use a predifined port by providing a custom RMISocketFactory as described here: http://insidecoffe.blogspot.com/2012/02/firewall-friently-rmi-port-fixing.html

(Note specially the hint that it may cause problems if you use JMX in parallel)

like image 33
Jan Wiemer Avatar answered Oct 05 '22 13:10

Jan Wiemer