# openjdk11- tomcat9- no ipv6



## overtime (Mar 20, 2020)

*x86 machine, freebsd12, tomcat9, openjdk8 >> openjdk11 (from ports, amd64)*

Hi all,

Running tomcat on openjdk11 (apparently my webapp needs it) results in no ipv6. No mention of a problem in catalina.out unless I set connector.address to ipv6-specific ip number. Then catalina.out includes:


```
19-Mar-2020        12:15:20.602 SEVERE [main]        org.apache.catalina.util.LifecycleBase.handleSubClassException        Failed to initialize component [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException:        Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:983)
... 
Caused        by: java.net.SocketException: Protocol family unavailable
```
 
It works nicely with openjdk8. With openjdk11 it works (so far) on ipv4.
 On ubuntu dev machine, tomcat9 runs fine with openjdk11.

Your thoughts?


----------



## 20-100-2fe (Mar 20, 2020)

Write short program that reads a page on a web server using its IPv6 address in the URL.
If it fails, the problem might be in the port of OpenJDK, or the machine's configuration.
If it works, the problem is in Tomcat's configuration.

But before doing this, check you have the following lines in your /etc/fstab:

proc                    /proc   procfs  rw              0       0
fdesc                   /dev/fd fdescfs rw              0       0

And that module fdescfs is loaded (procfs is already compiled into the kernel by default).


----------



## overtime (Mar 20, 2020)

Thank you for your response.
I am thinking its the jdk11. All works fine with jdk8. The OS works regardless; DNS-6, ICMP-6, etc all fine. One tomcat cfg change to jdk11 and no ipv6 for web (netstat shows listener on tcp4 only). I was under the impression that my .war files contained their own jvm  and that the tomcat jvm was irrelevant. This is apparently not so, as my .war files do not start in tomcat/ jdk8 since I reconfigured my IDE to compile using jdk11(because some libraries need it and jdk8 is becoming somewhat deprecated). Otherwise I would be happy to just leave tomcat on jdk8.
Is this the right forum, or should I try to contact the freebsd-java people?
Thanks again for your help.


----------



## ucomp (Mar 21, 2020)

try:

```
sysctl -w net.inet6.ip6.v6only=0
```


----------



## overtime (Mar 21, 2020)

Tried:  `sysctl -w net.inet6.ip6.v6only=0`
Effect: tomcat still listens only on tcp4 (using jdk11)

Using: `netstat -an` after tomcat restart

```
relevant line:
tcp4       0      0 *.8443                 *.*                    LISTEN
```
BTW, newbie >> moderator: what tag to use for paste from stdout? (preserve tab formatting, etc)


----------



## ucomp (Mar 22, 2020)

overtime said:


> Tried:  `sysctl -w net.inet6.ip6.v6only=0`
> Effect: tomcat still listens only on tcp4 (using jdk11)
> 
> Using: `netstat -an` after tomcat restart
> ...



since I didn't use/test ipv6-mapping myself yet , you could reopen :








						Setting/getting socket options fails on FreeBSD · Issue #63 · battleblow/openjdk-jdk11u
					

Some internal JDK tests are failing on FreeBSD during calls to set socket options. In particular, the following two produce failures: jdk/java/net/SocketOption/OptionsTest.java jdk/jdk/net/Sockets/...




					github.com
				



or send us a new issue-report  :








						Issues · battleblow/openjdk-jdk11u
					

BSD port of OpenJDK 11. Contribute to battleblow/openjdk-jdk11u development by creating an account on GitHub.




					github.com
				



thank you
-- edit:--
if you're not familiar with git or jdk-details just send 
issue-report to freebsd-java@freebsd.org , it will directly be read by the jdk-team


----------

