aspose file tools*
The moose likes Distributed Java and the fly likes Port already in use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Port already in use" Watch "Port already in use" New topic
Author

Port already in use

Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Hi folks! Happy New Year!!

I'm having problems with rmi. It doesn't matter which port I choose, I get Port already in use: 1212

Here's the code:

rmiregistry 1212 &
rmiregistry 1212 & java -cp classes -Djava.rmi.server.codebase=file:classes/ example.hello.Server
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

The default port for the RMI Registry is 1099. Just leave out the port number.


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Thanks Edward!

My mistake was on the second line. The correct command is:
java -classpath classDir -Djava.rmi.server.codebase=file:classDir/ example.hello.Server

The documentation says to use an & in the end of the command, but it works without it and I don't know its utility.

So I just executed this in one console: rmiregistry
And this in on the other console: java -classpath classDir -Djava.rmi.server.codebase=file:classDir/ example.hello.Server

Regards,
Leandro.
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

If you want to start a new process:
Windows is: start rmiregistry [optional port]
Unix is: rmiregistry [optional port] &

 
wood burning stoves
 
subject: Port already in use