Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException when binding

 
Veshnu Ramakrishnan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you setting the codebase property when you run your server?
 
Veshnu Ramakrishnan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic