【问题标题】:Why won't Wildfly listen on http port?为什么 Wildfly 不监听 http 端口?
【发布时间】:2016-07-01 09:45:22
【问题描述】:

我想做的事:

我想在 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 端口? 非常感谢我接下来可以尝试的任何建议。

日志

https://1drv.ms/f/s!Ao4w10eVqKCjbLJ3OQdiy_WH9Q8

【问题讨论】:

    标签: http port wildfly


    【解决方案1】:

    在浏览您的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>
    

    【讨论】:

      猜你喜欢
      • 2019-09-29
      • 2012-08-20
      • 1970-01-01
      • 2018-09-28
      • 1970-01-01
      • 2019-05-26
      • 1970-01-01
      • 2019-10-24
      • 1970-01-01
      相关资源
      最近更新 更多