aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Problem" Watch "RMI Problem" New topic
Author

RMI Problem

Dave Teare
Ranch Hand

Joined: Oct 09, 2002
Posts: 80
Hi All,
I had my assignment working with RMI, when I decided I did not like the class name of my remote server and refactored it to a new name.
Now my client can no longer bind to the RMI server! I get this exception:

I register the server in RMI as follows:

And then I access the server from the client as such:

FBNDataBaseRemoteImpl is defined as follows:

Am I missing something, or perhaps mistyped something? Like I said, everything was fine before I changed the class name.
Help!
Thanks!
--Dave.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Can you try to create the _Stubs again and give it a try?
Dave Teare
Ranch Hand

Joined: Oct 09, 2002
Posts: 80
I have tried recompiling all the code, including the stub. Also, I even rebooted the machine on the off chance some rouge process was hanging around. But alas, it still fails with a class cast exception.
I stepped through the code with the debugger, and the Naming.lookup does indeed return a valid FBNDataBaseRemoteImpl_Stub object. The problem occurs when I cast it to a FBNDataBaseRemoteImpl object.
The FBNDataBaseRemoteImpl object extends UnicastRemoteObject and implements Remote. Is there something wrong with my FBNDataBaseRemoteImpl declaration?
Thanks!
--Dave.
Dave Teare
Ranch Hand

Joined: Oct 09, 2002
Posts: 80
Fixed it!!!
It was a JDK/JRE version problem. I had an older JRE sitting in the system path, and somehow my vm must have been loading some older files.
I have no idea how my RMI implementation could have ever worked, I did not change the PATH or CLASSPATH. Perhaps when I modified the code, I inadventantly caused a diffent code path to be executed within the underlying RMI impl.
Anyway, there goes 4 hours of my life! On to the next bug!
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

Nah, it didn't help for me. I have Oracle's JRE in my path, and I removed it, even at the expense of not being able to run some Oracle tools. And the deleted all the class files and recompiled and re-rmic'd but still no avail.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dave Teare
Ranch Hand

Joined: Oct 09, 2002
Posts: 80
Mark,
What exception are you getting? Is it a class cast? Post some snipits of code and I will compare it to mine as well as trying it on my machine.
I found the RMI incredibly easy to set up and get working THE FIRST TIME. Once it broke, it is very hard to debug!
If you want to, mail me the relevant code and I will test it on my machine.
Good Luck!
--Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI Problem