]
Tomaz Cerar commented on WFLY-5288:
-----------------------------------
This is result of using attribute groups and I doubt we can do anything to fix this.
When parsing an xml element that represents resource in model tree (for example
/subsystem=msg/resource=me)
rules in order are:
- first parse all xml attributes on xml element, which map to attributes on resource
- then parse all attribute groups, which are sub elements that have attributes on them,
that attributes are still mapped to same resource
- after all sub elements that are found to be attribute groups are parsed we move to
parsing all other child elements that are mapped to child resources.
this is then looped for all elements that are found.
So in your case, "security" element is treated as attribute group, where
security-setting is a sub resource.
and as long as all attribute group elements are before all sub resource elements it will
work.
Don't force precise sequence of attributes in messaging-activemq
subsystem
--------------------------------------------------------------------------
Key: WFLY-5288
URL:
https://issues.jboss.org/browse/WFLY-5288
Project: WildFly
Issue Type: Bug
Components: JMS
Affects Versions: 10.0.0.Beta2
Reporter: Miroslav Novak
Assignee: Jeff Mesnil
In configuration of messaging-activemq subsystem we force precise sequence of attributes.
It's hard to find correct place for attribute if xml is configured manually.
For example configuration like:
{code}
<security enabled="false"/>
<security-setting name="#">
<role name="guest"
delete-non-durable-queue="true" create-non-durable-queue="true"
consume="true" send="true"/>
</security-setting>
{code}
works but if attributes are switched:
{code}
<security-setting name="#">
<role name="guest"
delete-non-durable-queue="true" create-non-durable-queue="true"
consume="true" send="true"/>
</security-setting>
<security enabled="false"/>
{code}
server fails to start with:
{code}
15:12:18,884 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:354)
at
org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:272)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[314,17]
Message: WFLYCTL0377: Unexpected element
'{urn:jboss:domain:messaging-activemq:1.0}security' encountered. Valid elements
are: 'replication-master, shared-store-master, connector-service, http-acceptor,
broadcast-group, cluster-connection, bindings-directory, replication-slave,
shared-store-slave, shared-store-colocated, live-only, address-setting, jms-queue,
pooled-connection-factory, large-messages-directory, divert, journal-directory,
in-vm-acceptor, replication-colocated, http-connector, discovery-group, remote-acceptor,
acceptor, connection-factory, remote-connector, in-vm-connector,
legacy-connection-factory, grouping-handler, jms-topic, connector, security-setting,
bridge, paging-directory, queue'
at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:98)
at
org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:286)
at
org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:158)
at
org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:279)
at
org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:158)
at
org.wildfly.extension.messaging.activemq.MessagingSubsystemParser_1_0.readElement(MessagingSubsystemParser_1_0.java:605)
at
org.wildfly.extension.messaging.activemq.MessagingSubsystemParser_1_0.readElement(MessagingSubsystemParser_1_0.java:66)
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:547)
at
org.jboss.as.server.parsing.StandaloneXml_4.readServerElement(StandaloneXml_4.java:244)
at org.jboss.as.server.parsing.StandaloneXml_4.readElement(StandaloneXml_4.java:143)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:69)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:47)
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
15:12:18,887 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server
boot has failed in an unrecoverable manner; exiting. See previous messages for details.
{code}