Skip to main content

Problems launching deployed applications in GlassFish 3.1.1 on RHE Linux server

No replies
redhat19
Offline
Joined: 2012-01-31
Points: 0

Greetings,

I have just installed GlassFish 3.1.1 (build 12) on a RHE 5 Linux server. I have been able to deploy two applications. But when these applicatioins are lauched, the browser gives a Error 101 (net::ERR_CONNECTION_RESET): Unknown error.

Using telnet, it shows that the ports are listening as they should.

> telnet localhost 8080

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

Connection closed by foreign host.

> telnet localhost 8181

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

Connection closed by foreign host.

Using strace, I watched what it was doing as connections were made and disconnected by telnet:

[root@xyz ~]# telnet 0 8181

Trying 0.0.0.0...

Connected to 0.

Escape character is '^]'.

GET /

Connection closed by foreign host.

Here's what strace showed:

[pid 12893] futex(0x2aaab5146ae0, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>

[pid 12893] <... futex resumed> ) = -1 EAGAIN (Resource temporarily unavailable)

[pid 12893] futex(0x2aaab5146ae0, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>

[pid 12893] <... futex resumed> ) = 0

[pid 12893] read(422, <unfinished ...>

[pid 12893] <... read resumed> "GET /\r\n", 20480) = 7

[pid 12893] read(422, <unfinished ...>

[pid 12893] <... read resumed> 0x622a690, 20473) = -1 EAGAIN (Resource temporarily unavailable)

[pid 12893] shutdown(422, 0 /* receive */) = 0

[pid 12893] shutdown(422, 1 /* send */) = 0

[pid 12893] dup2(19, 422) = 422

[pid 12893] futex(0x2aaab5146b0c, FUTEX_WAIT_PRIVATE, 5, NULL <unfinished ...>

Here's what the support department of our hosting service had to say about this results:

"We believe this shows pretty clearly that the issue is with the application itself. The code is simply shutting down the connection after the read."

Support had made an earlier comment, back when we were having difficulty starting GlassFish:

Hi,

I think I have found the problem.

[root@xyz bin]# pwd

/usr/glassfish/bin

[root@xyz bin]# strace -f ./asadmin start-domain

From the strace output, I found:

[pid 5997] bind(52, {sa_family=AF_INET, sin_port=htons(4848), sin_addr=inet_addr("0.0.0.0")}, 16) = 0

[pid 5997] bind(52, {sa_family=AF_INET, sin_port=htons(4848), sin_addr=inet_addr("123.123.123.123")}

So it looks like it tried to bind to every IP it can find.

The 123.123.123.123 IP is the incorrect IP to use.

This is because your server is in a firewall NAT environment, only the firewall will know that IP, and translate it to 123.123.123.123 for the server to use.

To help you with this, I have updated /etc/hosts with the private IP against the hostname.

Please can you check your Glassfish application, and make sure you explicitly tell it to use 123.123.123.123, and start it up again.

The hosting company does not support GlassFish and as such, can't seem to help beyound this point.

I have tried to start GlassFish specifically with the 123.123.123.123 ip address using the instructions here: http://trmueller.wordpress.com/2010/08/27/glassfish-3-1-on-a-multihomed-...

but the result is the same. The applications can't still be lauched.

I would appreciate any helpful input I get get here.

Thanks..

PS: I changed the actual IP address to 123.123.123.123 since I was posting here on a public forum. I also changed an actul name to ABC.