运行standalone.sh时如何调试Wildfly失败?

时间:2018-09-03 11:09:03

标签: cors wildfly

我无法在wildfly中运行我的cors标头。

这是我的standalone.xml

<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" enable-http2="true"/>
         <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
         <host name="default-host" alias="localhost">
         <location name="/" handler="welcome-content"/>
         <access-log/>
         <filter-ref name="server-header"/>
         <filter-ref name="x-powered-by-header"/>
         <filter-ref name="gzipFilter" predicate="exists('%{o,Content-Type}') and regex(pattern='(?:application/javascript|text/css|text/html|text/xml|application/json)(;.*)?', value=%{o,Content-Type}, full-match=true)"/>
         <filter-ref name="Access-Control-Allow-Origin"/>
         <filter-ref name="Access-Control-Allow-Methods"/>
         <filter-ref name="Access-Control-Allow-Headers"/>
         <filter-ref name="Access-Control-Allow-Credentials"/>
         </host>
     </server>
     <servlet-container name="default">
        <jsp-config development="true" tag-pooling="false"/>
        <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"/>
         <gzip name="gzipFilter"/>
         <response-header name="Access-Control-Allow-Origin" header-name="Access-Control-Allow-Origin" header-value="*"/>
         <response-header name="Access-Control-Allow-Methods" header-name="Access-Control-Allow-Methods" header-value="GET, POST, OPTIONS, PUT"/>
         <response-header name="Access-Control-Allow-Headers" header-name="Access-Control-Allow-Headers" header-value="accept, authorization, content-type, x-requested-with"/>
         <response-header name="Access-Control-Allow-Credentials" header-name="Access-Control-Allow-Credentials" header-value="true"/>
     </filters>
</subsystem>

./ standalone.sh的结果是:

18:44:34,491 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) "WFLYCTL0193: Failed executing subsystem undertow boot operations"
18:44:34,493 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("parallel-subsystem-boot") failed - address: ([]) - failure description: "\"WFLYCTL0193: Failed executing subsystem undertow boot operations\""
18:44:34,499 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

任何人都可以建议...

1 个答案:

答案 0 :(得分:0)

您可以尝试提高JBoss类的调试级别(例如“ org.jboss.as”和/或“ org.jboss.as.config”)。

在您的“ standalone.xml”文件中:

<subsystem xmlns="urn:jboss:domain:logging:5.0">
            ...
            <logger category="org.jboss.as.config">
                <level name="DEBUG"/>
            </logger>

然后重新启动服务器