我想做的事情:
我想在Ubuntu上运行Wildfly(作为Oracle VM)。
问题:
我最近发现它停止在http端口上侦听。以下有希望证明Wildfly正在运行并配置为在8080上侦听。但是,没有任何东西在监听这个端口:
polly@polly-VirtualBox:/opt/wildfly/bin$ ./jboss-cli.sh
Listening for transport dt_socket at address: 8787
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
[disconnected /] connect
[standalone@localhost:9990 /] [standalone@localhost:9990 /] /socket-binding-group=standard-sockets/socket-binding=http:read-resource
{
"outcome" => "success",
"result" => {
"client-mappings" => undefined,
"fixed-port" => false,
"interface" => undefined,
"multicast-address" => undefined,
"multicast-port" => undefined,
"name" => "http",
"port" => expression "${jboss.http.port:8080}"
}
}
polly@polly-VirtualBox:~$ sudo netstat -pl | grep 8080
polly@polly-VirtualBox:~$ sudo netstat -pl | grep 9990
tcp 0 0 localhost:9990 *:* LISTEN 1106/java
polly@polly-VirtualBox:~$ ps -ef | grep 1106
polly 1106 1036 2 09:18 ? 00:00:05 java -D[Standalone] -server -Xms64m -Xmx512m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Dorg.jboss.boot.log.file=/opt/wildfly/standalone/log/server.log -Dlogging.configuration=file:/opt/wildfly/standalone/configuration/logging.properties -jar /opt/wildfly/jboss-modules.jar -mp /opt/wildfly/modules org.jboss.as.standalone -Djboss.home.dir=/opt/wildfly -Djboss.server.base.dir=/opt/wildfly/standalone -c standalone.xml
polly 2477 2384 0 09:22 pts/0 00:00:00 grep --color=auto 1106
我尝试了什么:
抵消港口似乎毫无意义,因为据我所知,8080实际上是免费的,但无论如何我都试过了(无济于事):
polly@polly-VirtualBox:/opt/wildfly/bin$ sudo netstat -pl | grep 8180
polly@polly-VirtualBox:/opt/wildfly/bin$ sudo netstat -pl | grep 10090
tcp 0 0 localhost:10090 *:* LISTEN 3165/java
polly@polly-VirtualBox:/opt/wildfly/bin$ curl -X GET http://localhost:10090/console/App.html
<!DOCTYPE html>
<html>
<head>
<title>Management Interface</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<script type="text/javascript" language="javascript" src="app/app.nocache.js"></script>
<link rel="shortcut icon" href="/console/images/favicon.ico" />
</head>
<body>
<!-- history iframe required on IE -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0px;height:0px;border:0px"></iframe>
<!-- pre load images-->
<div style="visibility:hidden"><img src="images/loading_lite.gif"/></div>
</body>
</html>
polly@polly-VirtualBox:/opt/wildfly/bin$ curl -X GET http://localhost:8180
curl: (7) Failed to connect to localhost port 8180: Connection refused
我也尝试过研究日志(链接如下),但我看不出任何明显的问题。
我的问题:
为什么Wildfly没有在http端口上监听? 任何有关我接下来可以尝试的建议都将受到高度赞赏。
日志
答案 0 :(得分:3)
在浏览你的standalone.xml
时,我看到你修改了它。例如,与默认standalone.xml
相比,您删除了整个配置文件部分。要使Web服务器正常工作,您至少需要Undertow。
至少,您需要添加:
<profile>
<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
<websockets/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>
</profile>