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

Custom RMI socket tutorial does not run on Sparc/Solaris 2.6.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description


      The tutorial "Creating a Custom RMI Socket Factory" is at
      http://java.sun.com/products/jdk/1.2/docs/guide/rmi/rmisocketfactory.doc.html
      The source can be obtained by clicking on "here" near the bottom of the tutorial
      web page. Compilation and execution directions are at the URL
      http://java.sun.com/products/jdk/1.2/docs/guide/rmi/installedCsfHowTo.doc.html .

      My attempt at this involves scripts X0.ksh, X1.ksh, X2.ksh, and X3.ksh.
      They should be run, in order, from the same directory as that which contains the
      source code. The variable SOURCE_DIRECTORY in the script will have to be
      changed for your environment. Setting SOURCE_DIRECTORY=${PWD} should do the
      trick.

      algol% cat X0.ksh
      #!/bin/ksh
      JDK=/net/mulder.eng/export/mulder3/jdk12x/`/bin/uname -p`/jdk1.2FCS_R
      PATH=${JDK}/bin:/usr/dt/bin:/usr/bin:/bin:/usr/openwin/bin
      export PATH
      export LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib
      unset CLASSPATH
      javac -d . *.java
      rmic -d . examples.rmisocfac.HelloImpl

      algol% cat X1.ksh
      #!/bin/ksh
      JDK=/net/mulder.eng/export/mulder3/jdk12x/`/bin/uname -p`/jdk1.2FCS_R
      PATH=${JDK}/bin:/usr/dt/bin:/usr/bin:/bin:/usr/openwin/bin
      export PATH
      export LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib
      unset CLASSPATH
      export SOURCE_DIRECTORY=/home/ajacobs/java.dir/rmi/rmitutorial/RMISocFac
      rmiregistry -J-Djava.compiler=none -J-Djava.security=${SOURCE_DIRECTORY}/mypolicy &

      algol% cat X2.ksh
      #!/bin/ksh
      JDK=/net/mulder.eng/export/mulder3/jdk12x/`/bin/uname -p`/jdk1.2FCS_R
      PATH=${JDK}/bin:/usr/dt/bin:/usr/bin:/bin:/usr/openwin/bin
      export PATH
      export LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib
      export CLASSPATH=${HOME}/java.dir/rmi/rmitutorial/RMISocFac
      export SOURCE_DIRECTORY=${HOME}/java.dir/rmi/rmitutorial/RMISocFac
      java -Djava.compiler=none -Djava.rmi.server.codebase=file:${SOURCE_DIRECTORY}/ -Djava.security.policy=${SOURCE_DIRECTORY}/mypolicy examples.rmisocfac.HelloImpl

      algol% cat X3.ksh
      #!/bin/ksh
      JDK=/net/mulder.eng/export/mulder3/jdk12x/`/bin/uname -p`/jdk1.2FCS_R
      PATH=${JDK}/bin:/usr/dt/bin:/usr/bin:/bin:/usr/openwin/bin
      export PATH
      export LD_LIBRARY_PATH=/usr/dt/lib:/usr/openwin/lib
      export SOURCE_DIRECTORY=/home/ajacobs/java.dir/rmi/rmitutorial/RMISocFac
      java -Djava.compiler=none -Djava.security.policy=${SOURCE_DIRECTORY}/mypolicy examples.rmisocfac.HelloClient

      algol% cat mypolicy
      grant {
              // Allow everything for now
              permission java.security.AllPermission;
      };


      Unfortunately, my attempt to start up the server fails.

      algol% X2.ksh
      Warning: JIT compiler "none" not found. Will use interpreter.
      using xor sockets
      HelloImpl err: access denied (java.net.SocketPermission 129.146.78.54:55323 connect,resolve)
      java.security.AccessControlException: access denied (java.net.SocketPermission 129.146.78.54:55323 connect,resolve)
              at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:246)
              at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
              at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:342)
              at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
              at java.rmi.Naming.rebind(Naming.java:165)
              at examples.rmisocfac.HelloImpl.main(HelloImpl.java:63)
      java.security.AccessControlException: access denied (java.net.SocketPermission 129.146.78.54:55323 connect,resolve)
              at java.security.AccessControlContext.checkPermission(AccessControlContext.java:195)
              at java.security.AccessController.checkPermission(AccessController.java:403)
              at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
              at java.lang.SecurityManager.checkConnect(SecurityManager.java:1006)
              at java.net.Socket.<init>(Socket.java:258)
              at java.net.Socket.<init>(Socket.java:98)
              at examples.rmisocfac.XorSocket.<init>(XorSocket.java:64)
              at examples.rmisocfac.MultiClientSocketFactory.createSocket(MultiClientSocketFactory.java:68)
              at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:462)
              at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:194)
              at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:178)
              at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
              at sun.rmi.transport.DGCImpl_Stub.clean(Unknown Source)
              at sun.rmi.transport.DGCClient$EndpointEntry.makeCleanCalls(DGCClient.java:562)
              at sun.rmi.transport.DGCClient$EndpointEntry.access$10(DGCClient.java:557)
              at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(DGCClient.java:476)
              at java.lang.Thread.run(Thread.java:479)

      DNS should be used for looking up any machines. 129.146.78.54 is the Internet address of the
      machine that the example was run on (algol).

      algol% cat resolv.conf
      domain eng.sun.com
      nameserver 129.150.254.2
      nameserver 129.146.1.151
      nameserver 129.146.1.152
      nameserver 129.146.1.171
      algol% cat nsswitch.conf |grep hosts
      # "hosts:" and "services:" in this file are used only if the
      hosts: dns xfn nis [NOTFOUND=return] files


      allan.jacobs@Eng 1998-11-24

        Attachments

          Activity

            People

            Assignee:
            ldorninsunw Laird Dornin (Inactive)
            Reporter:
            ajacobssunw Allan Jacobs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: