Bug 1058959

Summary: [GSS] (6.2.x) JBMETA-371: DefaultPropertyReplacer + PropertyResolver is broken for vault expressions
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Chris Dolphy <cdolphy>
Component: EEAssignee: Chao Wang <chaowan>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bmaxwell, cdewolf, jawilson, kanovotn, rdickens, smumford
Target Milestone: CR2   
Target Release: EAP 6.2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Property replacement failed when enabled via +spec-descriptor-property-replacement+ because of a fault in the algorithm. It assumed that the contents of the expression string were contained between "${" and "}", also that it used a fixed format like the previous JBoss EAP system properties, for example, +propertyname[: default value])+. The PropertyResolver would proceed to resolve +propertyname+ and that resolution attempt would fail. The algorithm has now been corrected and property replacement now occurs as expected.
Story Points: ---
Clone Of: 1056799 Environment:
Last Closed: 2014-06-02 12:49:27 UTC 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:
Bug Depends On: 1056799    
Bug Blocks: 1049365, 1058963, 1060260    

Description Chris Dolphy 2014-01-28 20:45:13 UTC
+++ This bug was initially created as a clone of Bug #1056799 +++

Description of problem:
After enabling property replacement with spec-descriptor-property-replacement, the property replacement fails.  

Version-Release number of selected component (if applicable):
EAP 6.2
JBoss Metadata 7.0.8

How reproducible:
With test case.

Steps to Reproduce:
1. Create vault with test::queue property:

mkdir standalone/configuration/vault

keytool -genseckey -alias vault -storetype jceks -keyalg AES -keysize 128 -storepass password -keypass password -keystore standalone/configuration/vault/vault.keystore

bin/vault.sh -k standalone/configuration/vault/vault.keystore -p password -s saltsalt -v vault -i 44 -e standalone/configuration/vault/ -b test -a queue -x /queue/HELLOWORLDMDBQueue

2. modify standalone-full.xml, adding the results of vault.sh 
3. modify standalone-full.xml, setting spec-descriptor-property-replacement to true

4. build and deploy sample war with mdb (based on helloworld-mdb quickstart)

Actual results:

Could log messages complaining that it can't find the queue:
17:00:22,108 INFO  [org.hornetq.ra] (default-threads - 2) HQ151000: awaiting topic/queue creation :test::queue::1
17:00:24,109 INFO  [org.hornetq.ra] (default-threads - 2) HQ151001: Attempting to reconnect org.hornetq.ra.inflow.HornetQActivationSpec(ra=org.hornetq.ra.HornetQResourceAdapter@371c02e5 destination=:test::queue::1 destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)


Expected results:
Successful mdb deploy.

Additional info:
Vault properties were intended to work because there is a VaultPropertyResolver registered.  However, the property resolving fails because it always is passed "VAULT" as the property name.  DefaultPropertyReplacer is terminating parsing at the ":" because it is looking for a default value to use if the property lookup fails.

--- Additional comment from JBoss JIRA Server on 2014-01-24 17:32:05 EST ---

Brian Stansberry <brian.stansberry> updated the status of jira JBMETA-371 to Resolved

Comment 4 Scott Mumford 2014-02-27 05:12:33 UTC
This bug has been marked for inclusion in the 6.2.2 Release Notes.

To meet a PM request to have a draft of the document available for review by 4th March 2014, ECS requires assistance from someone involved with it's resolution.

If someone could review the Doc Text field above, fill out any blanks and correct any inaccuracies, a draft can be completed in a timely manner.

Comment 7 Russell Dickenson 2014-03-05 23:08:08 UTC
Attention: Chris. That doc_text looks good to me. Thank you.

Comment 8 Katerina Odabasi 2014-03-06 14:45:23 UTC
Verified in 6.2.2.CP.CR2.