Skip to main content

Remote EJB lookup behind a firewall hangs

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2007-07-30


I am trying to lookup my remote EJB on a Glassfish server located behind a firewall. I have some test code which works happily between non-firewalled boxes, but if I try looking up the EJB behind a firewall, the lookup hangs.

I turned on the logging and when the lookup begins, I get the following entry

[#|2014-02-10T15:00:14.125+0000|FINE|glassfish3.1.2||_ThreadID=16;_ThreadName=Thread-4;ClassName=org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory;MethodName=setAcceptedSocketOptions;|setAcceptedSocketOptions: SocketOrChannelAcceptorImpl[7001 IIOP_CLEAR_TEXT true true] ServerSocket[addr=/,localport=7001] Socket[addr=/,port=61530,localport=7001]|#]

Which I guess means that the request has hit the box, but the lookup never completes. I can leave it in this state for days, and it will not timeout. The IIOP port has been configured to listen on 7001, and this works happily on the other servers.

If I kill the test code, then the server throws an IOException reporting an end-of-stream error. If anyone has any ideas as to what is causing this and how to solve it, I'd be very grateful.



Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-07-30

OK, I installed WireShark on both machines and now have more of an idea of what is going on.

The web server's external IP address is
It's internal IP address is

The client machine is running on the internal network on 10.44.666.1.

The client connects to Glassfish via the internal address.

The JNDI lookup works, and server replies to the client, but it sends back the external IP address, rather than the internal one. As a result, the client ignores the response and continues to wait for a response containing the internal IP address.

So what I want to know is, how can I make Glassfish respond with the correct IP address?