Tomcat server unavailable on tcp6 (IPV6)

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?

5 answers

1 accepted

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 Community Champion May 01, 2012

+1 this answer goes to my favorites!

1 votes
Dieter Community Champion Apr 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

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 Community Champion Apr 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?

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
Dieter Community Champion Apr 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
0 votes
Dieter Community Champion Apr 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

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.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,831 views 12 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot