• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Runtime error while registering Remote object

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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!
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic