Question

I'm working on a twitter like, using rmi. I work, on Windows and everything works fine.

But on linux I have :

java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.lang.ClassNotFoundException: server.SimpleBark
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:196)
    ...

This exception pops out on the client side, and it seems that the client does not use the codebase server, the codebase server doesn't receive any connection.

I repeat that everything works fine on Windows, i can't find where this comes from.

Was it helpful?

Solution

From the JDK 7 guides

From JDK 7 Update 21, the RMI property java.rmi.server.useCodebaseOnly is set to true by default.

From the JDK 7 guides, that hasn't been updated

java.rmi.server.useCodebaseOnly

If this value is true, automatic loading of classes is prohibited except from the local CLASSPATH and from the java.rmi.server.codebase property set on this VM. Use of this property prevents client VMs from dynamically downloading bytecodes from other codebases. This property is ignored in the implementations of 1.2 and 1.2.1 because of a bug.

So it would seem that the version of Java on your Windows machine is out of date. Once updated, the best way to fix this is to include the required classes on the client side rather than dynamically loading classes across the network.

OTHER TIPS

Just remove the classes from the client and registry class paths.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top