2

我在 Docker 中运行一个 jar 文件(主机 macosx),在启动过程中我得到了这个堆栈跟踪:

10:42:28,101 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) 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

rating_1       | 10:42:28,401 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
rating_1       |     ("subsystem" => "undertow"),
rating_1       |     ("server" => "default-server"),
rating_1       |     ("http-listener" => "default")
rating_1       | ]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.listener.default" => "org.jboss.msc.service.StartException in service jboss.undertow.listener.default: Could not start http listener
rating_1       |     Caused by: java.net.SocketException: Protocol family unavailable"}}
rating_1       | 10:42:28,405 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "ejb3")]) - failure description: {"WFLYCTL0288: One or more ser
vices were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.ejb.default-local-ejb-receiver-service",
"jboss.ejb3.ejbClientContext.default",
"jboss.ejb3.localEjbReceiver.value"
],
"Services that may be the cause:" => ["jboss.remoting.remotingConnectorInfoService.http-remoting-connector"]
}}

似乎,它无法启动 http 服务器,某些服务没有安装?我使用的是正确的 docker 镜像吗?

Dockerfile:

FROM java:8


RUN mkdir -p /var/rating
ADD *.jar /var/rating

#ADD tomcat-users.xml /usr/local/tomcat/conf/

EXPOSE 8095
EXPOSE 8096
CMD ["java", "-jar", "/var/rating/ratingFacade-swarm.jar", "-server", "-d 64"]

我可能做错了什么,但我不知道是什么!可能是接口问题还是套接字问题?

编辑:

这些是我在 docker-compose.yml 中传递的环境变量:

JAVA_TOOL_OPTIONS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8096,server=y,suspend=n -Dfile.encoding=UTF-8 -Xms128M -Xmx384M -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=8 -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+ScavengeBeforeFullGC -XX:+UseBiasedLocking -Dswarm.project.stage=stage -Dswarm.http.port=8095"
4

1 回答 1

4

java.net.SocketException: Protocol family unavailable部分似乎是最重要的。我会尝试添加通常-Djava.net.preferIPv4Stack=true的内容,看看是否有帮助。

于 2017-10-06T11:27:55.177 回答