• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rmi ClassNotFoundException stub

 
s ravi chandran
Ranch Hand
Posts: 317
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I am trying out a simple RMI example given at: http://patriot.net/~tvalesky/easyrmi.html. I have modified anything in it. Now, the issue is that when I run the RMI Server , i get the class not found exception :



Now, I have searched on google, and it seems that normally it is supposed to happen when client doesnt have the STUB file. What I dont understand is, why is it happening at the server end?
Please point out what I am missing.
Thanks
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11852
185
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What files do you have in your directory after step 6? On my computer I have:

See that "myRMIImpl_Stub.class" - that is probably what you are missing. Try step 6 again - if there are errors, let us know.

I am assuming you are using an early version of the JDK. Since JDK 5 you should not need stubs.

Personally I would recommend the Oracle RMI Tutorial. Tom Valesky's example does not use good coding conventions, and forces you through some unnecessary hoops.
 
s ravi chandran
Ranch Hand
Posts: 317
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying. I am using seperate folders for source and class files. This is what I have in the bin folder of this project:



I know about the RMI tutorial from sun,but this example seems shorter.. the thing is that I had this same issue with my actual project also.. That is why i used this simple example as an experimental stuff, just to see what is possible wrong. And my java version is :



When I use javap in the same bin folder :



how is javap finding the class and java is not?
 
Ove Lindström
Ranch Hand
Posts: 326
Android Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have all the classes on both the client and the server side?

Then doing an RMI call, you do not actually send the class over to the other side, only the information about what and how to trigger it. If the receiver doesn't have the class that is supposed to be called in the classpath, then it is hard to find it.
 
s ravi chandran
Ranch Hand
Posts: 317
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually in this folder I have everything related with this sample example, the client and the server code and the stub file.. I am trying to run this first and then I will move on to making it work remotely. But the error at server end is just confusing. The client side doesnt even come into the picture, unless the server runs perfectly( locally first).

Then doing an RMI call, you do not actually send the class over to the other side, only the information about what and how to trigger it


How to do that? Will the syntax change for this?
 
Harshal Mekhale
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its either due registry issue or rmic compatibility.first try manually i.e by starting rmiregistry if it fails then try programatically. and while generating stub and skel files use
"rmic -vcompat" command
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic