[jboss-jira] [JBoss JIRA] (WFCORE-7) MapAttributeDefinition and ListAttributeDefinition incorrectly assume valid types in convertParameterExpressions

Brian Stansberry (JIRA) issues at jboss.org
Thu Jul 17 09:34:29 EDT 2014


     [ https://issues.jboss.org/browse/WFCORE-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Stansberry reassigned WFCORE-7:
-------------------------------------

    Assignee: Brian Stansberry


> MapAttributeDefinition and ListAttributeDefinition incorrectly assume valid types in convertParameterExpressions
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: WFCORE-7
>                 URL: https://issues.jboss.org/browse/WFCORE-7
>             Project: WildFly Core
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Domain Management
>    Affects Versions: 1.0.0.Alpha3
>            Reporter: Brian Stansberry
>            Assignee: Brian Stansberry
>             Fix For: 1.0.0.Alpha4
>
>
> The AttributeDefinition.convertParameterExpression method is called before the validator has validated the model node. This is because the conversion is part of doing any configured "cleanup" of the node before validation. (See AS7-6224.)
> MapAttributeDefinition and ListAttributeDefinition break this in their overrides of the method by doing unsafe type conversions. When these fail, users get unfriendly failure messages instead of the ones that the validators would provide.
> For example, this bogus CLI command:
> {code}
> [standalone at localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:write-attribute(name=valid-connection-checker-properties, value=1)
> {code}
> Produces this in the server log:
> {code}
> 15:46:42,167 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 4) WFLYCTL0013: Operation ("write-attribute") failed - address: ([
>     ("subsystem" => "datasources"),
>     ("data-source" => "ExampleDS")
> ]): java.lang.IllegalArgumentException
> 	at org.jboss.dmr.ModelValue.asPropertyList(ModelValue.java:100) [jboss-dmr-1.2.0.Final.jar:1.2.0.Final]
> 	at org.jboss.dmr.ModelNode.asPropertyList(ModelNode.java:384) [jboss-dmr-1.2.0.Final.jar:1.2.0.Final]
> 	at org.jboss.as.controller.MapAttributeDefinition.convertParameterExpressions(MapAttributeDefinition.java:252) [wildfly-controller-1.0.0.Alpha2.jar:1.0.0.Alpha2]
> 	at org.jboss.as.controller.AttributeDefinition.validateAndSet(AttributeDefinition.java:439) [wildfly-controller-1.0.0.Alpha2.jar:1.0.0.Alpha2]
> 	at org.jboss.as.controller.AbstractWriteAttributeHandler.execute(AbstractWriteAttributeHandler.java:88) [wildfly-controller-1.0.0.Alpha2.jar:1.0.0.Alpha2]
> 	at org.jboss.as.controller.operations.global.WriteAttributeHandler.execute(WriteAttributeHandler.java:98) [wildfly-controller-1.0.0.Alpha2.jar:1.0.0.Alpha2]
> {code}
> There should be nothing in the server log at all for that error; the validator should have caught it and generated an appropriate failure response to the client.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list