This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

about rmiregistry  RSS feed

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!