javarmiregistry

RMI Registry Issue: rmiregistry may cause unintended exceptions when binding with codebase using the "file:" URL scheme


Please see the passage "RMI Registry Issue" of this article for the background on Java Update 1.6.0_29 first.

If I understand correctly (I'm german), the update introduces a bug in the rmiregistry which fails to work with the file: pattern in the codebase.

I.E. the following won't work any more with 1.6.0_29:

-Djava.rmi.server.codebase="file:myproject/bin/ ..."

We are currently using the feature of having a codebase with file: syntax. Does anyone know a workaround for making this work?

Note: No, we do not want to start a local webserver or ftp server.

Update:

On Naming.bind this exception is thrown:

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(UnicastServerRef.java:400)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:248)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)

Solution

  • I had the same problem, and can confirm that downgrading JDK to earlier version solves the problem. I know, it's not a solution you're looking for, but at least it makes it to work.