CLI permits an invalid configuration of logging subsystem in JBoss EAP 6.

Solution Verified - Updated -

Issue

  • Issuing the below command generates an invalid domain.xml configuration:
[domain@localhost:9999 subsystem=logging] /profile=default-full-ha-profile/subsystem=logging/periodic-rotating-file-handler=hello_file_handler:add(append=true,autoflush=true,enabled=true,formatter="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n",level=ALL,name=hello_file_handler,named-formatter=PATTERN,suffix=".yyyy-MM-dd",file={relative-to => jboss.server.log.dir,path => "hello.log"})
{
    "outcome" => "success",
    "result" => undefined,
    "server-groups" => undefined
}

which causes the below exception :

[Host Controller] 17:09:37,269 ERROR [org.jboss.as.host.controller] (Controller Boot Thread) JBAS010932: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
.....
.....
[Host Controller] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1913,21]
[Host Controller] Message: JBAS014789: Unexpected element '{urn:jboss:domain:logging:1.5}formatter' encountered
  • The above issue is due to the fact that the formatter element is used twice in CLI command.The problem here is that CLI itself which is permitting a wrong configuration to be installed. The CLI should avoid this kind of errors. The result is a broken configuration, if stopped the domain controller will not start again and the configuration must be fixed manually.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content