• 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

about rmiregistry

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I use the following commands to start server:

After I stop the server, and exit the console,
if I want to restart the server again, I got
the following error: "Port already in use."
Does that mean rmi registry still listen on
the port (I use the default port)? How can I
fix this?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I have encounted the same problem. I fixed it by adding the code:System.exit(0). I don't know the exact reason. I guess, the stop server is not exit the server, so the port still be used.
Am I right?

Ying Ren
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
The RMI Registry is a seperate process basically it binds to a port (1099) by default. Your Java program (the Server) looks up on the Registry to retrieve an object but other than that it has nothing to do with the registry. There is no reason for the registry to die just because your Java program terminates.
You will need to kill the RMI Registry and the exit the server program every time you wish to re-run. Alternatively I would have thought you can get away with leaving the RMI Registry running but just restarting the Java server. So use this first time:
rmiregistry &
java -jar -server.jar &
Then just use:
java -jar -server.jar &
Good luck
Ian
 
Holmes Wong
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys.
Ying: where did you put System.exit(0)? Since your
server always runs. Did you provide a gui for your
server?
Ian: That is what I am thinking, its just a bit
too restrictive.
[ July 14, 2002: Message edited by: Holmes Wong ]
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


After I stop the server, and exit the console,
if I want to restart the server again, I got
the following error: "Port already in use."


The other way to do it is to start the registry from the server program itself. When the server shuts down, it will shut down the registry as well.
Eugene.
 
Holmes Wong
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:

The other way to do it is to start the registry from the server program itself. When the server shuts down, it will shut down the registry as well.
Eugene.


Thanks, Eugene.
I also tried that, and encountered the same problem. I am using linux, maybe its just a linux-related problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic