I am running a Hello World example for java RMI
1) I run the registry in an empty folder
motta@motta-laptop ~/tmp $ rmiregistry
2) I start the HTTP server to retrieve the classes at runtime. The download folder contains the remote interface for the client-server
motta@motta-laptop ~/download $ java NanoHTTPD 8080
3) I start the server passing the java.rmi.server.codebase property as suggested in the java RMI tutorial
motta@motta-laptop ~/server $ java -Djava.rmi.server.codebase="http://localhost:8080" WarehouseServer
The RMI registry is not contacting the HTTP server and is throwing an exception (see details after the question). But if I do the following
1) Start the rmi registry with the java.rmi.server.codebase property
motta@motta-laptop ~/tmp $ rmiregistry -J-Djava.rmi.server.codebase="http://localhost:8080/"
2) Start the HTTP server as before
3) Start the server without any option
motta@motta-laptop ~/server $ java WarehouseServer
it works, but why? It seems that with the first procedure the RMI registry is ignoring the java.rmi.server.codebase property
Thank you
=================================
I am running
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
The exception from the RMI registry
Constructing server implementation...
Binding server implementation to registry...
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: Warehouse
at sun.rmi.server.UnicastServerRef.oldDispatch(Unicast