[jboss-jira] [JBoss JIRA] (WFCORE-809) Can not parse an ObjectListAttributeDefinition of a PersistentResourceDefinition
Tomaz Cerar (JIRA)
issues at jboss.org
Fri Jul 10 10:47:03 EDT 2015
[ https://issues.jboss.org/browse/WFCORE-809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088537#comment-13088537 ]
Tomaz Cerar commented on WFCORE-809:
------------------------------------
We don't have any convention / impl about how complex attributes should be persisted / marshaled in PRD.
for time being you will need to provide custom marshaller / persister for that attribute.
> 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: Tomaz Cerar
>
> 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