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

RH Bugzilla Integration (JIRA) issues at jboss.org
Fri Sep 19 04:11:02 EDT 2014


    [ https://issues.jboss.org/browse/WFCORE-7?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004185#comment-13004185 ] 

RH Bugzilla Integration commented on WFCORE-7:
----------------------------------------------

Petr Kremensky <pkremens at redhat.com> changed the Status of [bug 1056578|https://bugzilla.redhat.com/show_bug.cgi?id=1056578] from ON_QA to VERIFIED

> 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
>          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.3.1#6329)


More information about the jboss-jira mailing list