Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Camel microservices in Docker (Section 18.1.2) 'Protocol family unavailable' error for wildfly-swarm #68

Closed
surjitsen opened this issue Jun 6, 2017 · 2 comments

Comments

@surjitsen
Copy link

surjitsen commented Jun 6, 2017

When running wildfly-swarm as described in section 18.1.4 on Windows 7 with boot docker running on Oracle VirtualBox the following error gets thrown:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.undertow.listener.default: org.jboss.msc.service.StartException in service jboss.undertow.listener.default: Could not start http listener
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:142)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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:190)
at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:243)
at org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.java:126)
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:138)
... 5 more
The solution to this problem is to add the following section to the pom.xml:
<plugins>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${wildfly-swarm-version}</version>
<!-- Add configuration element before executions element -->
<configuration>
<properties>
<java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
</properties>
</configuration>
<executions>
...
Stackoverflow link: https://stackoverflow.com/questions/37273621/fail-to-start-jax-rs-service-on-wildfly-swarm

@davsclaus
Copy link
Contributor

Thanks for sharing this

davsclaus added a commit that referenced this issue Jun 7, 2017
@benjaminkomen
Copy link

Thank you so much for sharing this! I tried to add a line in my Dockerfile:
ENV JAVA_OPTS -Xms256m -Xmx512m -Djava.net.preferIPv4Stack=true
but this does not work :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants