Meaningless Drivel is fun!*
The moose likes Distributed Java and the fly likes ClassNotFoundException when binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "ClassNotFoundException when binding" Watch "ClassNotFoundException when binding" New topic
Author

ClassNotFoundException when binding

Veshnu Ramakrishnan
Ranch Hand

Joined: Sep 27, 2005
Posts: 44
hi
I get the following exception while binding the object to the RMIREGISTRY.
I checked using javap that obs.system.db.synchronization.DataSynchronizerImpl_Stub is in the classpath.
Can any one tell me what could cause this problem.
the exception is listed below:

java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: obs.system.db.synchronization.DataSynchronizerImpl_Stub


Veshnu<br />SCBCD<br />SCWCD<br />SCJP
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Are you setting the codebase property when you run your server?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Veshnu Ramakrishnan
Ranch Hand

Joined: Sep 27, 2005
Posts: 44
hi
I got the problem. I ran the RMIREGISTRY at my codebase and then it worked. Other than that how to set the codebase property explicitly while running RMIREGISTRY.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Hmmm... you shouldn't have to run rmiregistry in the same directory - you should be specifying the "java.rmi.server.codebase" property on the command line when you run your server. This page talks all about the codebase property. In the troubleshooting section the first troubleshooting tip states -

"The first problem you might encounter is the receipt of a ClassNotFoundException when attempting to bind or rebind a remote object to a name in the registry. This exception is usually due to a malformed codebase property, resulting in the registry not being able to locate the remote object's stubs or other classes needed by the stub.

It is important to note that the remote object's stub implements all the same interfaces as the remote object itself, so those interfaces, as well as any other custom classes declared as method parameters or return values, must also be available for download from the specified codebase.

Most frequently, this exception is thrown as a result of omitting the trailing slash from the URL value of the property. Other reasons would include: the value of the property is not a URL; the path to the classes specified in the URL is incorrect or misspelled; the stub class or any other necessary classes are not all available from the specified URL."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException when binding