0

I have a Glassfish 4 server with a deployed application running on xubuntu 12.04 which can not be accessed remotely with an ejb client. I can access to a local glassfish server. I've seen too many forums where they explain that it is a glassfish 'bug' in linux, locally searching the hostname, etc, etc.. So, the given solution is to add the IP and the hostname in the /etc/hosts on linux. This is my /etc/hosts on my server 'myserver':

127.0.0.1 localhost locahost.localdomain localhost4 localhost4.localdomain4     # I saw this line on internet
192.168.1.100   myserver

But the client can not access to myserver. This is the setup that I have on myserver computer:

IP LAN of my server (fixed): 192.168.1.100 
Hostname: myserver 
IP WAN : (dinamyc)
domain name: mydomain.org 

In my router I have opened ports 3700 and 4848 and makes an IP forwarding from the WAN to the LAN IP of myserver. Also, my router update my DynDNS account whenever change my IP WAN. I would add that I have configured a NAS server on port 8080 (BarracudaDrive) which I access directly from the browser: http://mydomain.org

I configured glassfish to remotely manage, and I can do it without problems from internet: http://mydomain.org:4848 Also, I modified (following another solution) the glassfish IIOP listener with the following settings:

network address: 192.168.1.100 (which could also put 'myserver')
listener port: 3700
listener: enabled

Glassfish starts successfully.

Remotely from a client on a windows 7 computer, I try to connect to the server as follows:

props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty("org.omg.CORBA.ORBInitialHost", "mydomain.org");
props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
....
lookup = context.lookup("beanName");

context.lookup freezes 'gone' unanswered for a long time until I have to kill the application manually.

I also tried adding client-server configuration to the system: System.setProperty ("org.omg.CORBA.ORBInitialHost", "mydomain.org");

Nothing.

I've also tried adding in the /etc/hosts on windows the IP WAN (xx.yyy.aaa.bbb) of 'myserver' (though the WAN IP is dynamic but I wanted to try if it worked) xx.yyy.aaa.bbb myserver

After adding this, I also tried with 'props.setProperty ("org.omg.CORBA.ORBInitialHost", "myserver");'

Nothing.

If I turn off the glassfish server, 'context.lookup', after about 1 minute, returns a 'org.omg.CORBA.COMM_FAILURE: Detailed: 00,410,001: Connection failure: SocketType: IIOP_CLEAR_TEXT; hostname: myserver, port: 3700 ..... . etc ', which is correct I guess.

It does not work. If I put the url: mydomain.org:3700 in the chrome browser, then download a file containing 'GIOP' and some strange characters, which tells me that domain and port are working. The wireshark software shows me that there is dialogue between my local WAN IP and the remote IP of myserver, although I do not know how to decipher the dialogue.

Finally, I copied the same jars of my glassfish server to the client, if any difference in versions.

Nothing. It does not work. I already read EJB remote application-client and Unable to do a remote ejb access from a different host and .....etc.

Please Help Me..!!!

Community
  • 1
  • 1
roneypc
  • 315
  • 1
  • 3
  • 6

2 Answers2

0

Maybe its a little late, but I stumbled accross the same issue. It seems Glassfish has a bug which prohibits EJB acces if the server is behind a Firewall/Proxy or any kind of NAT (Docker in our case). Maybe you will have more luck with another application server.

lordvlad
  • 5,200
  • 1
  • 24
  • 44
0

I experienced the same issue. I have an app client running an host B, which I could access locally, but not remotely from host A. Pinging host B on host A gave me an internet addresses 192.x.x.x, but pinging host B on host B gave me an address 172.x.x.x. The reason for this was, that I have 2 active network adapters on host B:

- Ethernet (default switch) with the iPv4-address 172.x.x.x
- WiFi with iPv4-address 192.x.x.x

After deactivating the Ethernet adapter on host B I could start the app client on host B from host A remotely. I am running window 10, Glassfish 5.0.1 and JDK 1.8.0

MohammedAli
  • 2,361
  • 2
  • 19
  • 36
Bost
  • 1