Bug 1171809

Summary: ResolveExpressionHandler is overly simplistic in expression resolution
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Brian Stansberry <brian.stansberry>
Component: Domain ManagementAssignee: Brian Stansberry <brian.stansberry>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.4CC: dandread, kkhan, myarboro
Target Milestone: DR13   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brian Stansberry 2014-12-08 16:23:10 UTC
Description of problem:

ResolveExpressionHandler deliberately does not make use of the full range of expression resolutions sources, because by design the intent is not to support vault resolution.
However, the way it implements that limitation is by simply calling ModelNode.resolve(). That is overly restrictive, as DMR alone does not support other valid resolution features, i.e. nested expressions and recursive resolution.
Fix is to switch the handler to use an ExpressionResolver impl, just one that doesn't plug in the vault resolver.

Version-Release number of selected component (if applicable):

6.4.0.DR12, although similar issues exist in 6.3, just not reproducible using the nested expression example below, as nested expressions aren't supported there.

How reproducible:

Always.

Steps to Reproduce:
1. Add 3 system properties:

[standalone@localhost:9999 /] /system-property=A:add(value=a)
{"outcome" => "success"}
[standalone@localhost:9999 /] /system-property=B:add(value=b){"outcome" => "success"}
[standalone@localhost:9999 /] /system-property=ab:add(value=asd)
{"outcome" => "success"}

2.

Use the "resolve-expressions" op to try and resolve a nested expression:

[standalone@localhost:9999 /] :resolve-expression(expression=${${A}b})


Actual results:

{
"outcome" => "failed",
"failure-description" => "JBAS014802: Cannot resolve expression '${${A}b}'",
"rolled-back" => true
}

Expected results:

{ "outcome" => "success", "result" => "asd" }

Comment 3 Kabir Khan 2014-12-09 14:53:18 UTC
https://github.com/jbossas/jboss-eap/pull/2139

Comment 5 Petr Kremensky 2014-12-10 08:39:17 UTC
Verified on EAP 6.4.0.DR13