• 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 rebind throwing MarshalException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using code similar to what has been posted to programmatically start the RMI registry. That is, I try to create a new registry using LocateRegistry.createRegistry(Registry.REGISTRY_PORT), but if an ExportException is thrown (indicating that there is already an rmiregistry bound to the well-known port on the local host), I fall back to getting a reference to the already running registry using LocateRegistry.getRegistry(Registry.REGISTRY_PORT). After obtaining a reference to the registry, I call rebind() with a new instance of my remote implementation of the database class.

The rebind() call works fine when called on a reference returned by the createRegistry() call, but throws a MarshalException (with a causal NotSerializableException) when called on an already running registry returned by getRegistry().

The only difference I can find is that createRegistry() returns an object of type RegistryImpl, but getRegistry() returns a RegistryImpl_Stub.

Can anyone help me?
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've just built a very small test for this.
The server looks like this:


and works fine either when I call it with no registry running or when running the rmiregistry manually from the commandprompt before starting the server.

I am using Tiger here, I'll try it under 1.4 at work tomorrow if I remember.
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeroen Wenting:

I am using Tiger here, I'll try it under 1.4 at work tomorrow if I remember.



It should work on 1.4.2, I use very similar code on that platform.
 
Todd Sims
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only thing I could think of was to upgrade from 1.4.0 to 1.4.2. I'll upgrade my SDK and let you know.

Thanks.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tried under 1.4.1 on Linux (Sun VM and compiler), worked just fine.
reply
    Bookmark Topic Watch Topic
  • New Topic