|
The server address is being
translated....
----- Original Message -----
Sent: Wednesday, November 20, 2002 9:36
PM
Subject: Re: Connection to ejb server via
rmi client through nat
It's unclear from your message whether the address of the
server or client is being translated. If the client address is being
translated, you should have no problems with client to server
connections.
If the server address is being translated, you've got a
problem. Most implementations of RMI servers embed the server address and port
in the client proxies. The client then receives a remote object (actually a
proxy implementing Remote) which contains the server's private address. The
NAT router doesn't have anyway to translate the address embeded in the proxy.
So when the client attempts to use a method of the remote object, the request
is sent to the server's private address.
There are two general
solutions to this problem:
- Use an RMI proxy server which will receive the request on a public
address and forward it to the server's private address. Search the list
archives of announcements of RMI proxy servers.
- Modify the proxies or RMI server to embed or translate the server's
private address to the public one. Most servers will allow you to specify a
RMIClientSocketFactory. A quick hack that has worked for me in the past is
to implement a RMIClientSocketFactory that translates the address it's given
in the createSocket method to the public address, then creates a socket
using the public address.
Of course, you should check with your
server vendor to see if they have already developed a
solution.
--Victor
deepak wrote:
I am trying to connect to the EJB Server from a rmi client and there is
NAT(Network Address Translator) in between. Due to this NAT , this thing
doesnt work. Any idea how i can work this out.
Thanks.
Deepak.
*********************************************************
Disclaimer
This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.
*********************************************************
Visit us at http://www.mahindrabt.com
|