Search code examples
javarmi

JDK7u21 RMI changes


The Release Notes of JDK7u21 specified the changes related to RMI:

From this release, the RMI property java.rmi.server.useCodebaseOnly is set to true by default. In previous releases the default value was false.

This change of default value may cause RMI-based applications to break unexpectedly. The typical symptom is a stack trace that contains a java.rmi.UnmarshalException containing a nested java.lang.ClassNotFoundException.

If these exceptions occur, the preferred way to solve the problem is to configure all RMI clients and servers to use the same codebase, by specifying proper values in the java.rmi.server.codebase system property. This is typically done by adding the -D option to the command that starts up the application: java -Djava.rmi.server.codebase=file:////(path-to-remote-classes)/

It also specified in the documentation here that workaround is to set the java.rmi.server.useCodebaseOnly property back to false.

However, even when I explicitly set this property to false, I am getting an exception mentioned above. Any clue here please?

And if I have to solve it by the preferred way described above (by setting the -Djava.rmi.server.codebase=file:////(path-to-remote-classes)/, then which path should I set over here? My workspace/bin?


Solution

  • I am sorry, I solved it on my own. The problem was wrong number of parameters were being passed to my .ksh file. This caused the problem starting RMI registry.