Name: rm29839 Date: 12/04/97
Applications exporting remote objects cannot be
used to send RMI-client calls through a firewall.
They simply ignore the properties like
http.proxyHost and generate a
NoRouteToHostException. The same application
without RMI-server support works well.
The problem can be demostrated by the following
code:
/**
* This class sits on a server behind a
* firewall while the host real.internet.name
* can be reached only through that proxy.
*/
public class BugImpl extends UnicastRemoteObject
implements Bug {
static {
if ( System.getSecurityManager() == null )
System.setSecurityManager( new RMISecurityManager() );
}
public BugImpl() throws RemoteException {
super();
System.getProperties().put( "http.proxySet" , "true" );
System.getProperties().put( "http.proxyHost", "firewall" );
System.getProperties().put( "http.proxyPort", "8080" );
try {
Registry reg = LocateRegistry.getRegistry();
reg.rebind( "Bug", this );
// The following line generate
// a NoRouteToHostException.
Naming.lookup( "//real.internet.name/RMIClass" );
}
catch( Exception e ) {
System.err.println( "Exception: " + e.getMessage() );
}
}
public String show() throws RemoteException {
return "Tutto ok";
}
}
public interface Bug extends Remote {
public String show() throws RemoteException;
}
(Review ID: 21262)
======================================================================