Java application gets error java.net.SocketException: Protocol family unavailable

Solution Verified - Updated -

Issue

  • Java application does not start and this error is in logging the exception java.net.SocketException: Protocol family unavailable

    Caused by: java.net.SocketException: Protocol family unavailable
            at java.net.PlainSocketImpl.socketBind(Native Method)
            at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
            at java.net.ServerSocket.bind(ServerSocket.java:375)
            at java.net.ServerSocket.<init>(ServerSocket.java:237)
            at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:55)
            at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:403)
            at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:650)
            at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
            at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
            ... 13 more
    

    Or

    Caused by: java.net.SocketException: Protocol family unavailable
            at sun.nio.ch.Net.bind0(Native Method)
            at sun.nio.ch.Net.bind(Net.java:433)
            at sun.nio.ch.Net.bind(Net.java:425)
            at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
            at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
            at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:178)
            at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:303)
            at org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.java:106)
            at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:199)
            ... 8 more='
    
  • When enabling IPv6 in operating-system, JBoss EAP adopting the IPv6 configuration automatically and disables at operating-system, JBoss EAP is crashing. Need to disable IPv6 permanently in JBoss EAP even operating-system has enabled or disabled IPv6 at operating-system level.

Environment

  • Red Hat Enterprise Linux (RHEL)
  • Apache Tomcat, Red Hat JBoss Web Server (JBoss Web)
  • OpenJDK, Oracle Java
  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7
  • Internet Protocol version 6 (IPv6) disabled at the kernel level

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content