引导期间捕获异常:org.jboss.as.controller.persistence.ConfigurationPersistenceException:WFLYCTL0085:无法解析配置

时间:2017-03-14 11:00:35

标签: java logging jboss wildfly

我将此配置添加到我的JBoss子系统中,并且我在构建时遇到了错误。

配置部分:

<subsystem xmlns="urn:jboss:domain:logging:3.0">
            <console-handler name="CONSOLE">
                <level name="INFO"/>
                <formatter>
                    <named-formatter name="COLOR-PATTERN"/>
                </formatter>
            </console-handler>
            <periodic-rotating-file-handler name="FILE" autoflush="true">
                <formatter>
                    <named-formatter name="PATTERN"/>
                </formatter>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <suffix value=".yyyy-MM-dd"/>
                <append value="true"/>
            </periodic-rotating-file-handler>
<!-- MY CONFIGURATION PART -->
    <file-handler name="ABC-FILE" autoflush="true">
                    <level name="INFO"/>
                    <formatter>
                        <pattern-formatter pattern="%-5p %d %C (%F:%M:%L) - %m%n"/>
                    </formatter>
                     <file relative-to="jboss.server.log.dir" path="ABC-Activity.log"/>
                    <suffix value=".yyyy-MM-dd"/>
                    <append value="true"/>
                </file-handler>
                <logger category="com.my.project.ActivityLogger">
                    <level name="INFO"/>
                     <handlers>
                        <handler name="ABC-FILE"/>
                    </handlers>
                </logger>

这里构建了web-app的错误:

ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
    at org.jboss.as.server.ServerService.boot(ServerService.java:357)
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[113,17]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:domain:logging:3.0}suffix' encountered
    at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:89)
    at org.jboss.as.logging.LoggingSubsystemParser_3_0.parseFileHandlerElement(LoggingSubsystemParser_3_0.java:521)
    at org.jboss.as.logging.LoggingSubsystemParser_3_0.readElement(LoggingSubsystemParser_3_0.java:152)
    at org.jboss.as.logging.LoggingSubsystemParser_3_0.readElement(LoggingSubsystemParser_3_0.java:97)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
    at org.jboss.as.server.parsing.StandaloneXml_4.parseServerProfile(StandaloneXml_4.java:546)
    at org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:242)
    at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:141)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:103)
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:49)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
    ... 3 more

11:52:57,717 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

我使用了此文档https://docs.jboss.org/author/display/AS71/Logging+Configuration#LoggingConfiguration-rootlogger

我错了???

1 个答案:

答案 0 :(得分:0)

根据我们的经验,这是由于错误的standalone.xml配置引起的。 Jboss非常复杂。他们为standalone.xml配置保留特定的历史文件。我不知道原因,这对他们的开发人员是个问题。 由于某些原因,standalone.xml有时有0个字节。

在中查找文件

JBOSS_AS_HOME/standalone/configuration/

在我们的情况下就是这样

drwxr-xr-x. 11 user user  4096 Mar 14 12:44 standalone_xml_history
-rw-rw-r--.  1 user user     0 Mar 14 12:44 standalone.xml

我们用standalone_xml_history目录中的最新“自动备份/历史记录”代替了;一切恢复正常。