• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI Problem

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you try to create the _Stubs again and give it a try?
 
Dave Teare
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dave Teare
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic