Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ExportException during a server restart!

 
Jai Karuppuswamy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic