Could not start Wildfly 'default' listener when launching Keycloak for ARD
search cancel

Could not start Wildfly 'default' listener when launching Keycloak for ARD

book

Article ID: 206185

calendar_today

Updated On:

Products

CA Agile Requirements Designer

Issue/Introduction

Starting Keycloak as below 

$ KEYCLOAK_HOME/bin/standalone.sh &

Getting below error: 

2021-01-07 18:21:36,079 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service org.wildfly.undertow.listener.default: org.jboss.msc.service.StartException in service org.wildfly.undertow.listener.default: HOSTNAME : Could not start 'default' listener.
243         at [email protected]//org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:211)
244         at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
245         at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
246         at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
247         at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
248         at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
249         at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
250         at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)
251         at java.base/java.lang.Thread.run(Thread.java:834)
252 Caused by: java.net.SocketException: Protocol family unavailable
253         at java.base/sun.nio.ch.Net.bind0(Native Method)
254         at java.base/sun.nio.ch.Net.bind(Net.java:455)
255         at java.base/sun.nio.ch.Net.bind(Net.java:447)
256         at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
257         at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80)
258         at [email protected]//org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:178)
259         at [email protected]//org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:303)
260         at [email protected]//org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.    java:106)
261         at [email protected]//org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:199)
262         ... 8 more

Environment

All supported ARD releases.

Cause

This is a an error from the JBOSS application server (Wildfly) that failed to open a socket to listen for incoming connections due to attempting to open an IPv6 socket

Resolution

The JAVA_OPTS environment variable must be set to contain -Djava.net.preferIPv4Stack=true prior to starting the IdentityAccessManager 

Modify the <keycloak>/bin/standalone.conf, adding these two lines:
#Force IPv4 connection
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"