doubt on RMI
Hi all,
i did one mini project on RMI concept. I have compiled interface, implementation program, server program and client program without any problems. and i got skeleton and stub classes. i received some exception while i am trying to run server and client files.
while i am trying to execute server file i got the following exception.....
Trouble: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: CalculatorImpl_Stub
and while i am trying to execute client file i got the follwing exceptions .....
java.rmi.NotBoundException: CalculatorService
what i have to do to execute successfully..
thanks in advance.
regards,
muthukumar
The first problem occurs because you don't have the proper classpath
And the second problem is caused by the first one
When you execute your server app be sure to have access through classpath to your classes, you should use something like:
java -classpath classes_dir yourpackage.YourServerClass
In that way you should be able to run your server. Keep in mind that the class needed is automatically generated by rmic. There is a byg chance that this classes are kept in the bin directory next to rmic. Move them to the proper directory and make the classpath point to it
The second error happends because it cannot retrieve that calculator service from the server, just because it is not registered. So there is nothing to bring back
Hope this helps
The Registry has to have access to the stub, the remote interface, and any application classes they depend on, via its classpath.
ejpa at 2007-7-14 22:29:54 >

Setting java.rmi.server.codebase is one solution.
The other solution is to make sure the Registry has access to your stubs, remote interfaces, etc via its classpath.
I normally recommend doing the latter in development situations, and solving the codebase issue as a deployment step.
ejpa at 2007-7-14 22:29:54 >
