[jboss-jira] [JBoss JIRA] (WFCORE-809) Can not parse an ObjectListAttributeDefinition of a PersistentResourceDefinition

Jeff Mesnil (JIRA) issues at jboss.org
Fri Jul 10 08:40:03 EDT 2015


Jeff Mesnil created WFCORE-809:
----------------------------------

             Summary: Can not parse an ObjectListAttributeDefinition of a PersistentResourceDefinition
                 Key: WFCORE-809
                 URL: https://issues.jboss.org/browse/WFCORE-809
             Project: WildFly Core
          Issue Type: Bug
          Components: Domain Management
    Affects Versions: 2.0.0.Alpha6
            Reporter: Jeff Mesnil
            Assignee: Brian Stansberry


My server resource defines an "interceptors" attribute:

{noformat}
        public static final ObjectTypeAttributeDefinition CLASS = ObjectTypeAttributeDefinition.Builder.of("class",
                create("name", ModelType.STRING, false)
                        .setAllowExpression(false)
                        .build(),
                create("module", ModelType.STRING, false)
                        .setAllowExpression(false)
                        .build())
                .build();

        public static final ObjectListAttributeDefinition INTERCEPTORS = ObjectListAttributeDefinition.Builder.of("interceptors", CLASS)
                .setAllowNull(true)
                .setAllowExpression(false)
                .setMinSize(1)
                .setMaxSize(Integer.MAX_VALUE)
                .build();
{noformat}

The "interceptors" is a LIST of "class" attribute which is an OBJECT composed of a "name" and "module" attribute.

I'm not sure what is the corresponding XML format for this attribute.
Ideally, I'd like to have this XML format:

{noformat}
    <server name="default" >
            ...
            <interceptors>
                <class name="org.bar.MyInterceptor"
                       module="org.bar" />
                <class name="org.baz.MyOtherInterceptor"
                       module="org.baz" />
            </interceptors>
            ...
      </server>
{noformat}

This XML can not be parsed and I have not found which XML representation can be parsed given my INTERCEPTORS definition.

The XML parsing fails with:

{noformat}
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[23,27]
Message: WFLYCTL0377: Unexpected element '{urn:jboss:domain:test:1.0}interceptors' encountered. Valid elements are: 'buffer-cache'
	at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:98)
	at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:270)
	at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:166)
	at org.jboss.as.controller.PersistentResourceXMLDescription.parseChildren(PersistentResourceXMLDescription.java:266)
	at org.jboss.as.controller.PersistentResourceXMLDescription.parse(PersistentResourceXMLDescription.java:166)
	at org.jboss.as.controller.PersistentResourceXMLParser.readElement(PersistentResourceXMLParser.java:41)
	at org.jboss.as.controller.PersistentResourceXMLParser.readElement(PersistentResourceXMLParser.java:35)
{noformat}

Corresponding test case in wildly-core is in my branch at https://github.com/jmesnil/wildfly-core/tree/parse_ObjectListAttributeDefinition






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list