• 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

ExportException during a server restart!

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have implemented a simple GUI for my server, and have provided a mechanism to start and stop the server.
When I try to stop the server and restart it, I get a ExportException. Specifically, the exception thrown is:

Here is the code snippet that I use to start the server:

I would appreciate your comments.
Thanks,
Jai.
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


When I try to stop the server and restart it, I get a ExportException
java.rmi.server.ExportException: internal error: ObjID already in use


That's because you are creating a registry that already has been created (during the first start up). Just bypass call to LocateRegistry.createRegistry(_port) on the subsequent server restarts. Better yet, don't use this silly server GUI, -- it adds absolutely nothing to your project reusability or design.
On the side note, do not use underscores in variable names (except in public final static variables), here is Java Coding Conventions
Eugene.
[ January 05, 2003: Message edited by: Eugene Kononov ]
 
Jai Karuppuswamy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eugene.
I have been thinking about getting rid of the UI myself, for the simple reason that I haven't been able to design a satisfactory UI.
But for the sake of getting things cleared up, is it not possible to change the port at which an RMI server is listening, without shutting down the VM.
I moved the Locateregistry.createRegistry(_port) code out of the method that starts the RMI server, and was able to get rid of the exception. If I wanted to change the port to which remote objects are bound, how would I do that.
Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic