Tomcat server unavailable on tcp6 (IPV6)

Oliver Lade April 23, 2012

I have just installed JIRA on an i686 Ubuntu 10.10 server using the Linux setup script. The server is already running JBoss on port 8080, so in the setup I specified port 8090 for JIRA's Tomcat.

Setup completed without error and stared the Tomcat server, but I cannot access it in my browser (Chrome says "Oops! Google Chrome could not connect to <hostname>:8090". JBoss on 8080 still works fine.

I ran netstat -antl and found of interest:

Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN

[...]

tcp6       0      0 :::80                   :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6       0      0 :::8090                 :::*                    LISTEN
tcp6       0      0 :::443                  :::*                    LISTEN
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN

It appears that Tomcat has bound itself to an IPv6 address (if I understand correctly; I don't know much about IPv6). It is listening on the port, but doesn't respond to my browser request (which is presumably an IPv4 request?).

Is there any way I can either get Tomcat using regular tcp or access it through a web browser?

6 answers

1 accepted

2 votes
Answer accepted
Oliver Lade May 1, 2012

Got it! The trick is to use the Java option:

-Djava.net.preferIPv4Stack=true

This should be added to /opt/atlassian/jira/bin/setenv.sh (or equivalent) in the JVM_REQUIRED_ARGS string (roughly line 20):

#
# The following are the required arguments for JIRA.
#
JVM_REQUIRED_ARGS="-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Djava.net.preferIPv4Stack=true"

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2012

+1 this answer goes to my favorites!

1 vote
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012
It looks like the Jira Tomcat binds itself to ipv6 addresses. Could you check the connector configuration in conf/server.xml ? Is there an address attribute in the server attribute? Does this contain an ipv6 address? If yes this should be changed to your ipv4 address
Oliver Lade April 25, 2012

I heard one workaround was to put address="0.0.0.0" into the Connector tag, so I did that. My Connector tag is as follows:

&lt;Connector address="0.0.0.0" port="8090"

                   maxThreads="150"
                   minSpareThreads="25"
                   maxSpareThreads="75"
                   connectionTimeout="20000"

                   enableLookups="false"
                   maxHttpHeaderSize="8192"
                   protocol="HTTP/1.1"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   acceptCount="100"
                   disableUploadTimeout="true"/&gt;

I can't see anything obviously wrong there, though it would be nice to have a protocol="" attribute.

Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012
The documentation about address says:

"For servers with more than one IP address, this attribute specifies which address will be used for listening on the specified port. By default, this port will be used on all IP addresses associated with the server" So if you can rewch your server from the client using ping a.b.c.d i'd use address="a.b.c.d" in server.xml. This should really force to bind Tomcat to tcp4. Else there might be some security feature on your system that doesn't let applications bind to other ipv4 addresses than 8080. Do you see anything unusual in catalina.out when you try this?

Oliver Lade April 25, 2012

Nothing in catalina.out, but now netstat -tulp reports this (where the X's are the correct first three numbers in the IP):

tcp6       0      0 X.X.X.128%16:8090 [::]:*                  LISTEN

... which seems odd. The %16 seems to change each time too (though it's not there if I do -tulpn... I have no idea what the right args are). Otherwise it all seems to be okay. catalina.out reports at the end:

26/04/2012 8:52:15 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-X.X.X.128-8090

0 votes
john carter October 22, 2018

For server issue and your server is lost due to any kind of problem folow Dlink Support to get instant help for your Router Server. This helps to fix my Router error when I chnage the connection IPv4 tp Ipv6 there is and server error, the server is lost. If you can facing the same problem follows the Dlink Support.

0 votes
Oliver Lade April 25, 2012

I heard one workaround was to put address="0.0.0.0" into the Connector tag, so I did that. My Connector tag is as follows:

&lt;Connector address="0.0.0.0" port="8090"

                   maxThreads="150"
                   minSpareThreads="25"
                   maxSpareThreads="75"
                   connectionTimeout="20000"

                   enableLookups="false"
                   maxHttpHeaderSize="8192"
                   protocol="HTTP/1.1"
                   useBodyEncodingForURI="true"
                   redirectPort="8443"
                   acceptCount="100"
                   disableUploadTimeout="true"/&gt;

I can't see anything obviously wrong there, though it would be nice to have a protocol="" attribute.

0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012
It looks like the Jira Tomcat binds itself to ipv6 addresses. Could you check the connector comfiguration on server.xml ? Is there an address attribute in the server attribute? Does this contain an ipv6 address? If yes thos should be changed to your ipv4 address
0 votes
Dieter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012
It looks like the Jira Tomcat binds itself to ipv6 addresses. Could you check the connector configuration in conf/server.xml ? Is there an address attribute in the server attribute? Does this contain an ipv6 address? If yes this should be changed to your ipv4 address

Suggest an answer

Log in or Sign up to answer