2 Replies Latest reply on May 17, 2007 11:15 PM by EJP

    rmi1

    843793
      Hi,
      my problem is:http://java.sun.com/docs/books/tutorial/rmi/compiling.html
      My cmd is call:
      D:\Documents and Settings\user >java -Djava.rmi.server.hostname=loc
      alhost -Djava.security.policy=server ComputeEngine
      ComputeEngine exception:
      java.security.AccessControlException: access denied (java.net.SocketPermission 1
      27.0.0.1:1099 connect,resolve)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkConnect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
      ource)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
      ource)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      at sun.rmi.server.UnicastRef.newCall(Unknown Source)
      at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
      at ComputeEngine.main(ComputeEngine.java:27)

      and 2sd

      D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.rmi.security.policy=cli
      ent.policy ComputePi localhost 999
      ComputePi exception:
      java.security.AccessControlException: access denied (java.net.SocketPermission 1
      27.0.0.1:1099 connect,resolve)
      at java.security.AccessControlContext.checkPermission(Unknown Source)
      at java.security.AccessController.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkPermission(Unknown Source)
      at java.lang.SecurityManager.checkConnect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.connect(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at java.net.Socket.<init>(Unknown Source)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
      ource)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
      ource)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      at sun.rmi.server.UnicastRef.newCall(Unknown Source)
      at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
      at ComputePi.main(ComputePi.java:16)

      thx very much
        • 1. Re: rmi1
          843793
          Do you hepl me please?I try it but on my pc keep not working so i don't know how possable.At school it's alright!

          Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
          ception is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.ClassNotFoundException: Compute
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:242)
          at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
          07)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
          at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
          28)
          at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
          )
          at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
          m.java:238)
          at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
          693)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
          ... 9 more

          D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.security.policy=policy.
          policy ComputeEngine
          ComputeEngine exception:
          java.rmi.ServerException: RemoteException occurred in server thread; nested exce
          ption is:
          java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
          tion is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
          n Source)
          at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
          at sun.rmi.server.UnicastRef.invoke(Unknown Source)
          at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
          at ComputeEngine.main(ComputeEngine.java:27)
          Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
          ception is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.ClassNotFoundException: Compute
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:242)
          at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
          07)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
          at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
          28)
          at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
          )
          at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
          m.java:238)
          at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
          693)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
          ... 9 more

          D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.security.policy=policy.
          policy ComputeEngine
          ComputeEngine exception:
          java.rmi.ServerException: RemoteException occurred in server thread; nested exce
          ption is:
          java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
          tion is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
          n Source)
          at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
          at sun.rmi.server.UnicastRef.invoke(Unknown Source)
          at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
          at ComputeEngine.main(ComputeEngine.java:27)
          Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
          ception is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.ClassNotFoundException: Compute
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:242)
          at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
          07)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
          at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
          28)
          at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
          )
          at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
          m.java:238)
          at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
          693)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
          ... 9 more

          D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.security.policy=policy.
          policy ComputeEngine
          ComputeEngine exception:
          java.rmi.ConnectException: Connection refused to host: 192.168.1.34; nested exce
          ption is:
          java.net.ConnectException: Connection refused: connect
          at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
          at sun.rmi.server.UnicastRef.newCall(Unknown Source)
          at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
          at ComputeEngine.main(ComputeEngine.java:27)
          Caused by: java.net.ConnectException: Connection refused: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(Unknown Source)
          at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
          at java.net.PlainSocketImpl.connect(Unknown Source)
          at java.net.SocksSocketImpl.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.<init>(Unknown Source)
          at java.net.Socket.<init>(Unknown Source)
          at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
          ource)
          at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
          ource)
          ... 6 more

          D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.security.policy=policy.
          policy ComputeEngine
          ComputeEngine exception:
          java.rmi.ConnectException: Connection refused to host: 192.168.1.34; nested exce
          ption is:
          java.net.ConnectException: Connection refused: connect
          at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
          at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
          at sun.rmi.server.UnicastRef.newCall(Unknown Source)
          at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
          at ComputeEngine.main(ComputeEngine.java:27)
          Caused by: java.net.ConnectException: Connection refused: connect
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(Unknown Source)
          at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
          at java.net.PlainSocketImpl.connect(Unknown Source)
          at java.net.SocksSocketImpl.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.connect(Unknown Source)
          at java.net.Socket.<init>(Unknown Source)
          at java.net.Socket.<init>(Unknown Source)
          at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
          ource)
          at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
          ource)
          ... 6 more

          D:\Documents and Settings\Hans-Peter Geerdes>java -Djava.policy.rmi.server.hostn
          ame=192.168.1.34:1099 -Djava.security.policy=policy.policy ComputeEngine
          ComputeEngine exception:
          java.rmi.ServerException: RemoteException occurred in server thread; nested exce
          ption is:
          java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
          tion is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
          n Source)
          at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
          at sun.rmi.server.UnicastRef.invoke(Unknown Source)
          at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
          at ComputeEngine.main(ComputeEngine.java:27)
          Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
          ception is:
          java.lang.ClassNotFoundException: Compute
          at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
          at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375
          )
          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
          at sun.rmi.transport.Transport$1.run(Transport.java:153)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
          60)
          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
          .java:701)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.ClassNotFoundException: Compute
          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:242)
          at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:7
          07)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
          at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
          at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
          28)
          at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294
          )
          at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
          m.java:238)
          at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494)
          at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
          693)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
          ... 9 more

          D:\Documents and Settings\Hans-Peter Geerdes>
          • 2. Re: rmi1
            EJP
            The Registry can't find the remote interface. The RMI Registry needs to execute with the same classpath as the client.