File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Runtime error while registering Remote object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Runtime error while registering Remote object" Watch "Runtime error while registering Remote object" New topic
Author

Runtime error while registering Remote object

jayashree murugan
Greenhorn

Joined: Feb 10, 2000
Posts: 22
I'm working on Unix. I've started the RMI Registry. When loading the Remote Object, I get this error.
-------------------------------------------
RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: MyServerImpl_Stub
-------------------------------------------
The skeleton and stub classes have been generated and are present in the same directory. I don't understand why it is asking for the stub while registering the server object. The stub is required only by the client ... isn't it?


[This message has been edited by jayashree murugan (edited July 12, 2000).]
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Originally posted by jayashree murugan:
I'm working on Unix. I've started the RMI Registry. When loading the Remote Object, I get this error.

Well, I maybe wrong but, RMI is dual communication. A stub defines how an object is sent and the skeleton defines how an object is recieved. Your client sends an object through the stub, the server recieves it through the skeleton. Once the server completes it's processing it sends the response through the STUB and your client recieves it through the SKELETON. The definitions for both communications is in one stub and one skeleton therefore a copy of the same stub and skeleton are required on both ends!

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Milind Kulkarni
Ranch Hand

Joined: Jun 01, 2000
Posts: 146
On making a call to the registry to bind the object, the registry actually binds a reference to the stub for the remote object. In order to instantiate a stub object, the registry VM needs to be able to load its class definition. The VM (in this case the server VM) that sends the serialized forms of a stub in a remote method call to the registry is responsible for annotating the stub with the location from which its classes can be downloaded. If stubs are not annotated properly, RMI will throw a ClassNotFoundException when it tries to instantiate the stub.
Check the following:
1> Value of To java.rmi.server.codebase property is set to the locations of the stub
2> It is possible that to enable the rmiregistry to unmarshal stub objects by placing all relevant stub class files in the CLASSPATH of the rmiregistry. However, the rmiregistry does not have to download stub classes. If stub classes are available locally, it will use those classes.
Something wierd:
I got a similar type of exception on my WIN 98 machine but if I invoke the Internet then problem seem to have gone.
Regards,
Milind

jayashree murugan
Greenhorn

Joined: Feb 10, 2000
Posts: 22
Milind, I've just started working on Java in the Unix Environment. I don't know Unix very well. I'm used to working on Windows. So I'll have to ask you very basic questions.
---------------------------------------------
"1> Value of To java.rmi.server.codebase property is set to the locations of the stub"
How do I set the codebase property?
---------------------------------------------
2> It is possible that to enable the rmiregistry to unmarshal stub objects by placing all relevant stub class files in the CLASSPATH of the rmiregistry. However, the rmiregistry does not have to download stub classes. If stub classes are available locally, it will use those classes.
How do I set the CLASSPATH of the rmiregistry?
----------------------------------------
Regards,
Jayashree

[This message has been edited by jayashree murugan (edited July 13, 2000).]
Milind Kulkarni
Ranch Hand

Joined: Jun 01, 2000
Posts: 146
Hi Jayashree,
Check out this URL for setting codebase property:
http://java.sun.com/products/jdk/1.2/docs/guide/rmi/codebase.html
Setting CLASSPATH for rmiregistry is no different from setting CLASSPATH to point to working directory.
Regards,
Milind
 
 
subject: Runtime error while registering Remote object
 
Similar Threads
RMI binding
Getting ot of memory Error while running on websphere
java.rmi.ServerException: java .rmi.UnmarshallException
Unable to get the home of ejb after certain requests
UnmarshalException?? Please help