• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Port already in use

 
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The default port for the RMI Registry is 1099. Just leave out the port number.
 
Leandro Coutinho
Ranch Hand
Posts: 430
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to start a new process:
Windows is: start rmiregistry [optional port]
Unix is: rmiregistry [optional port] &

 
I can't take it! You are too smart for me! Here is the tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic