Search code examples
network-programmingglassfishejbrmijndi

Connecting to remote Glassfish hosted EJB


The application i'm currently working on start to enter in a pre-release phase.

In this phase, the server-side application components are to be deployed on Amazon VMs while the client-side application remains on the user machine.

This applications connects to server using JNDI and RMI to call remote EJB methods. This works well on localhost and local network.

But, when trying to connect to Amazon host, the application hangs up on context.lookup method. that's to say a JNDI context can be obtained from this remote server, but no lookup can be performed on that context.

What can I do to obtain good diagnostic on the failure ?

Are there logs that can be generated for the RMI handshake/whatever ?

Is there any way to see on server side if query really drive its way through the internet to the server ?

Also notice I've already enabled public IP usage on my Glassfish server (using recommended Oracle procedure).

EDIT According to a fast TCP capture on server, it seems that server receives the client context query with in-lan client address, which it of course isn't aware of :

query is

[3/27/2012 11:05:22 AM:169]
GIOP.......(................NameService....._is_a...................
NEO................ª.......(IDL:omg.org/SendingContext/CodeBase:1.0.
...........n........172.27.63.145.ܺ....¯«Ë........e................
........... ................... ... ...........&...............(IDL:
omg.org/CosNaming/NamingContext:1.0.

reply is

[3/27/2012 11:05:22 AM:171]
GIOP.......2............NEO................0.......(IDL:omg.org/Send
ingContext/CodeBase:1.0............ô........46.137.114.67.'5....¯
«Ë........d........................... ................... .........
.....&...........!...|...............$....f............10.241.42.208
.'[email protected]....
...........+IDL:omg.org/CosNaming/NamingContextExt:1.0..............
.......10.241.42.208.'5...M¯«Ë.... ...d...  S1AS-ORB............Root
POA....TNameService............................... .................
.. ...  ...........&......

(as read using SmartSniff ASCII output).

The IP in query (172.27.63.145) is my IP in my company LAN. From what I understand of communication over itnernet, it should be my company LAN public IP, no ? How can I make Glassfish client udnerstand it should use that IP ?


Solution

  • Diagnostic has been clearly obtained : the client, which connects from a LAN to the server, sends its own internal network private address to server, which server can't forward any answer to. As a consequence, server doesn't answer, hence the hangup.