• 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

Problems with ports in RMI (UyB)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Helo everybody,

I am implementing my application server using RMI. I have one problem. The especification says:

...the program MUST allow the user to specify the location of the database, and it MUST also accept an indication that a local database is to be used

I understand (and i have read in other posts) that the server would let to set the location of the database and the port of the server. Well, here is a snippet of the code:



This code works fine when the port is 1099 (default RMI port) but launchs an java.net.ConnectException with othwer port. I have also read that the code would work if i put a security manager..but in the especification:

You MUST not require the installation of a security manager

So, i don't know what to do...should i keep the Keep it Simple Rule, forget the port and use a default one?.

I am using Fedora (core2) whith j2sdk 1.4.2_05

Thanks!
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my windows java app, it is no problem selecting the port for the server (exactly as you specify) the first time. However, once I had set the port for this registry residing in this particular JVM, I got an exception if I tried to create a new registry even at a new port. Thus the only way for me to change the port of the RMI server, once set, was to restart the program and the JVM.
AFAIK there is no way to change the port of the registry once set.

Maybe this answers your question or maybe not.

/J
 
Joakim Eriksson
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
About securityManager.
By not explicitly setting up a security manager, you are not allowed to do certain things such as dynamically loading remote classes (from say a webserver) used by your RMI client.
However in your case you are supposed to provide all needed classes in a jar file in addition to those already in the J2SE installation.
Hence, no need for a security manager.

I'm sure others have already written this somewhere in this forum.

/J
 
javier moreno garc�a
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, i think is the same behavior than in Fedora..anyway i'll probe it in my "windocer" .

Thanks!
 
javier moreno garc�a
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again,

I have found the answer to my question..i didn't see yesterday!

solution

Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic