Results 1 to 4 of 4

Thread: RMI problem

  1. #1
    naimab is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default RMI problem

    Hello,

    I have a client-server system that uses RMI for binding the two.
    I have been running the same code for years without difficulty, and suddenly I get the errors below when the server starts up and tries to rebind in the rmi registry. My policy file is accessible (mode 777) and has not been changed for a very long time. Its contents are:
    grant codebase "file:///home/naima/software/music/-" {
    permission java.security.AllPermission;
    };

    This problem has now appeared on two different machines, both running OpenSUSE linux, version 11.3.

    I would appreciate any pointers.

    Thanks,

    Abe

    Errors received are:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:400)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:248)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:3 59)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at tmc.server.MCServer.start(MCServer.java:400)
    at tmc.server.MCServer.main(MCServer.java:199)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknow n Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:390)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:248)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.ClassNotFoundException: access to class loader denied
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:426)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:163)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:620)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:247)
    at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.java:197)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:1574)
    at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1495)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1731)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1328)
    at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:350)
    ... 12 more
    Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /home/naima/software/music/mc/- read)
    at java.security.AccessControlContext.checkPermission (AccessControlContext.java:374)
    at java.security.AccessController.checkPermission(Acc essController.java:546)
    at java.lang.SecurityManager.checkPermission(Security Manager.java:532)
    at sun.rmi.server.LoaderHandler$Loader.checkPermissio ns(LoaderHandler.java:1154)
    at sun.rmi.server.LoaderHandler$Loader.access$000(Loa derHandler.java:1108)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:390)
    ... 21 more

  2. #2
    jdavies is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Re: RMI problem

    I'm suddenly having the same problem after an auto-update to JDK 1.6.0_29. I found this in the release notes:

    RMI Registry Issue
    A bug in the rmiregistry command included in this release may cause unintended exceptions to be thrown when an RMI server attempts to bind an exported object which includes codebase annotations using the "file:" URL scheme. The RMI servers most likely to be effected are those which are invoked only by RMI clients executing on the same host as the server.
    RMI annotates codebase information as part of the serialized state of a remote object reference to assist RMI clients in loading the required classes and interfaces associated with the object at runtime. Exported objects which are looked up in the RMI registry and invoked by RMI clients running on hosts other than the server are usually annotated with codebase URL schemes, such as "http:" or "ftp:" and these should continue to work correctly.
    As a workaround, RMI servers can set the java.rmi.server.codebase property to use codebase URLs other than the "file:" scheme for the objects they export.

  3. #3
    vinkal087 is offline Member
    Join Date
    Nov 2011
    Posts
    1
    Rep Power
    0

    Default Re: RMI problem

    Hi,

    I am new to RMI. I am also facing the same problem. If both JVM are in same machine then it is working fine. It does not work for 2 different machines.. Please tell if you got the solution.

    Thanks

  4. #4
    Grkn is offline Member
    Join Date
    Oct 2011
    Posts
    65
    Rep Power
    0

    Default Re: RMI problem

    It throws java.lang.ClassNotFoundException

    From question I can only say exception

    ClassNotFoundException :> most probably deserialization problem

    In object transfer in different computer :>

    If same package is added to server then it won't give error.
    Ex:
    You have Me.class in your package name as Pack in client computer.
    And client sends the Me.class to server.
    But server must have same package and class in its include libraries to get that class.
    If server can not find the class than it throws classnotfound exception.

    I hope this gives you sufficient help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •