users@glassfish.java.net

Re: How to connect Java SE client to Java EE module running on GlassFish?

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Sun, 16 Aug 2009 12:12:26 +1000

I'd like to share my thoughts on the observation that "Glassfish - I
have no idea why - puts into the response its own IP address". Please do
reply if you think I got it wrong.

When the client tries to access an EJB on the server, it first accesses
the naming server. GlassFish's naming server is on the orb-listener-1's
port (port 3700 on the DAS/non-clustered server by default).
So first the client contacts the naming service at the location
specified for ORBInitialHost and ORBInitialPort. The client receives an
IOR back which contains the location of where the EJB can be contacted.
The IOR should have the IP address as specified in the "Network Address"
field in Configurations> server-config> ORB> IIOP Listeners>
orb-listener-1 of the admin console and the port. If using SSL or mutual
authentication, it returns the IP addresses/port numbers of the
respective IIOP listeners.

 From the error message Nicklas posted, I get the impression the Network
Address field has not been set (still 0.0.0.0), so GF looks up network
addresses from the system and the first it gets is the internal address
192.168.1.10. That is then returned to the client in the IOR, so that's
what the client tries to access next.

What do you get if you put your public IP address in the Network Address
field, restart your server and run your client again?

Regards,
Dies


Witold Szczerba wrote:
>> If you want to be able to safely navigate through NAT, you'll need to
>> restrict yourself to protocols which only connect one-way and don't send
>> callback addresses that may not be accessible. [...]
>> I don't know personally whether RMI/CORBA can be made to work through
>> firewalls and NAT. The article you posted seems to suggest it is possible,
>> but may require some tweaking to get it to work right.
>
> This is nonsense. You think the RMI/CORBA is some kind of P2P
> protocol? No, this is "one-way", the problem is Glassfish - I have no
> idea why - puts into the response its own IP address. Maybe this is
> something about load balancing or something. Whatever reason it is -
> it has ugly side effect which should be considered a bug or a high
> priority feature to implement.