participate


Remote Method Invocation (RMI) - firewall, port redirection and RMI. Great problem. Help me please
<<   Back to Forum  |   Give us Feedback
This topic has 19 replies on 2 pages.    1 | 2 | Next »
b59c65
Posts:49
Registered: 5/31/02
firewall, port redirection and RMI. Great problem. Help me please   
Jan 9, 2003 7:22 AM

 
I have some linux machines behind one router.
I must to redirect the trafic to one machine, which has the RMI server.
I have read that the rmi runs into the 1099 port.
i have redirect this port but te application still doesn't run.
if i runs the application using the internal net i see tha the client conects to the RMI server using the 1099 port and also other hihg port (+32000).
this second port can i specify into the application?
how?
or which posts must i to open,a nd redirect?

Thanks
 
bschauwe
Posts:2,255
Registered: 2/10/99
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jan 9, 2003 1:16 PM (reply 1 of 19)  (In reply to original post )

 
Unless you do some extra work, rmi servers will communicate with clients using random ports.

o You can write and use your own rmi socket factory, which always assigns a fixed port number.

o You can - perhaps - have your server call its super and name a fixed port. (See the docs or source code for UnicastRemote object. I say "perhaps", because I have never used this.
 
charlie76
Posts:124
Registered: 11/13/00
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jan 9, 2003 2:39 PM (reply 2 of 19)  (In reply to original post )

 
You can change the port your RMI objects bind to by specifying it in your constructor when you call UnicastRemoteObject's super(). Look at the constructors for UnicastRemoteObject. One of them takes a port to bind to. You can put any number of RMI objects binding to the same port because they will share the ServerSocket being used. (One caveat is that all objects sharing the same port must use the same SocketFactory if you are using a non-default SocketFactory).

charlie
 
keithwee
Posts:4
Registered: 6/18/01
Re: firewall, port redirection and RMI. Great problem. Help me please   
Mar 12, 2003 12:16 AM (reply 3 of 19)  (In reply to #2 )

 
There is 1 question i would like to ask. Just like RMI registry running at port 1099, the client has to specify:
Naming.lookup("//rmiserverHostName:1099/xxx")
On the client side, must i specify the UnicastRemoteObject port to which the RMI server is supposed to listen?

Your help is appreciated.
 
gigiserban
Posts:13
Registered: 2/20/03
Re: firewall, port redirection and RMI. Great problem. Help me please   
Mar 13, 2003 10:38 PM (reply 4 of 19)  (In reply to #3 )

 
The port 1099 is the default port used by RMI to bind the object in the registry.It is not mandatory to specify it.
You can use any other port, but make sure to do it like you said in the last message.
Please take a look on my message that I posted earlier on this forum regarding RMI.
If your server is behind the Firewall, then you need to define two ports: one to bind the object in registry, the second one to communicate between client and server.Use FixedSocketFactory to custom the used ports.
One more think:Make sure they are opened and unused in the Firewall.

Hope this will solve your problem
Good luck.
Gheorghe
 
keithwee
Posts:4
Registered: 6/18/01
Re: firewall, port redirection and RMI. Great problem. Help me please   
Mar 16, 2003 7:52 AM (reply 5 of 19)  (In reply to #4 )

 
hi Gheorghe,

Thanx for replying. I have managed to define the 2 ports and run them up in the server. On the client side, what must i do to target at the 2 ports. For the registry port, i know i must do this:
Naming.lookup("//rmiserverHostName:<port>/xxx").

What about second one to communicate between client and server? What must i do at the client side?
 
bschauwe
Posts:2,255
Registered: 2/10/99
Re: firewall, port redirection and RMI. Great problem. Help me please   
Mar 17, 2003 8:30 AM (reply 6 of 19)  (In reply to #5 )

 
Nothing. That is a function of the RMI system.
 
keithwee
Posts:4
Registered: 6/18/01
Re: firewall, port redirection and RMI. Great problem. Help me please   
Mar 21, 2003 6:14 PM (reply 7 of 19)  (In reply to #6 )

 
indeed. I have got it all done up. thanx guys.
 
adesanyaa
Posts:1
Registered: 2/15/06
Re: firewall, port redirection and RMI. Great problem. Help me please   
Feb 15, 2006 8:35 AM (reply 8 of 19)  (In reply to #7 )

 
I have a similar problem is using RMI with our firewall using random high ports

Do you have any sample code of both client and server including the rim.policy file you can share

Thanks
 
secureSaeed
Posts:1
Registered: 7/12/06
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 12, 2006 9:30 PM (reply 9 of 19)  (In reply to #8 )

 
Hi,
We have SunSystems SunAccounts application ver 4. We want to connect the client to the remote site using the VPN. But, not able to do so. It only possible when all the TCP ports are open in the firewall. Then only client connects to Remote site.
Please give me the advice as why the SunSystems selects random port for the client server connection and how to secure the network when all the TCP ports are open.
 
rheesukhwan
Posts:5
Registered: 7/17/06
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 17, 2006 8:12 PM (reply 10 of 19)  (In reply to #9 )

 
Help !

I have two linux boxes, one as server running rmiregistry and a server program as daemon, and the other as client.
And there is one firewall machine between them.

The firewall allows
1. the access to 1099,12000 of server ports from client's any port.
2. the access to client's any port from server when the access is only the reply for the client's request.

The problem is
1. the server tries to make a new connection to client NOT as a reply from client's request.
2. it is always denied by firewall, and the server program is timed out.
3. I found that it was invoked by java.rmi.dgc

I want to know
1. howto set the client's port allowing to access from server's dgc.
2. howto disable the server's dgc, if possible.

Can I have any help?
 
ejp
Posts:26,283
Registered: 11/5/97
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 17, 2006 8:22 PM (reply 11 of 19)  (In reply to #10 )

 
Do you have client-side callbacks in your system? If so, you will have to export them on a fixed port and have your firewall open that port in the server->client direction.
 
rheesukhwan
Posts:5
Registered: 7/17/06
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 17, 2006 9:00 PM (reply 12 of 19)  (In reply to #11 )

 
Thank you.

The server/client program is multi-threading program.
Client's request is 32 max at the same time
and server's thread is 512 max per one client's request
at the same time.
I didn't know that java.rmi.dgc was occured in the server program.
So, I want to stop the java.rmi.dgc.
I failed to find that my program has any code occuring it.

Could you explain howto more detail ?
Sorry, I'm afraid I am not a good english speaker.
 
ejp
Posts:26,283
Registered: 11/5/97
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 17, 2006 9:52 PM (reply 13 of 19)  (In reply to #12 )

 
I don't know how to ask this any more clearly. Do you have any client-side callbacks in your system?

This means, do you export any remote objects at the client and send them to the server such that the server calls the client? In other words do any of your client classes implement a remote interface?

This is the only explanation I can think of for the server connecting to the client for DGC. If there are no callbacks the only DGC connections would be from client to server and they would most likely reuse the same ports that the remote objects are already listening on so they should go through your firewall as is.
 
rheesukhwan
Posts:5
Registered: 7/17/06
Re: firewall, port redirection and RMI. Great problem. Help me please   
Jul 17, 2006 10:06 PM (reply 14 of 19)  (In reply to #13 )

 
Thank you

This means, do you export any remote objects at the client and send >them to the server such that the server calls the client? In other words >do any of your client classes implement a remote interface?

I didn't have any purpose of implementing remote interface in the client classes.
I will check my codes right now more closely.
Thank you very much.
 
This topic has 19 replies on 2 pages.    1 | 2 | Next »
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 63
  • Guests : 118

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums