Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4097182

Changing proxy on the fly: no way

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.1.4
    • core-libs
    • sparc
    • solaris_2.5.1



      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)
      ======================================================================

            mwarressunw Michael Warres (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: