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..!!!