aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Problems with ports in RMI (UyB) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Problems with ports in RMI (UyB)" Watch "Problems with ports in RMI (UyB)" New topic
Author

Problems with ports in RMI (UyB)

javier moreno garc�a
Greenhorn

Joined: Jul 17, 2004
Posts: 3
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!
Joakim Eriksson
Greenhorn

Joined: Sep 13, 2004
Posts: 25
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

Joined: Sep 13, 2004
Posts: 25
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

Joined: Jul 17, 2004
Posts: 3
Well, i think is the same behavior than in Fedora..anyway i'll probe it in my "windocer" .

Thanks!
javier moreno garc�a
Greenhorn

Joined: Jul 17, 2004
Posts: 3
Hello again,

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

solution

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with ports in RMI (UyB)