Bug 826716 - Calculating Dynamic Group with more than one trait in Group Definition fails with QueryParameterException: could not locate named parameter
Calculating Dynamic Group with more than one trait in Group Definition fails ...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Resource Grouping (Show other bugs)
JON 2.4.1
x86_64 Linux
high Severity high
: ---
: JON 3.1.1
Assigned To: John Sanda
Mike Foley
:
Depends On: 667896
Blocks: 837078
  Show dependency treegraph
 
Reported: 2012-05-30 16:21 EDT by dsteigne
Modified: 2013-09-11 06:59 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 667896
: 837078 (view as bug list)
Environment:
Last Closed: 2013-09-11 06:59:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description dsteigne 2012-05-30 16:21:12 EDT
+++ This bug was initially created as a clone of Bug #667896 +++

Created attachment 472190 [details]
log snippet

Description of problem:

When calculating a dynamic group definition with more than one trait in the conditions a hibernate exception occurs. No group members are found.


Version-Release number of selected component (if applicable):
JON 2.4
EAP Plugins
SOAP Plugins
EWS Plugins
JDK 1.6 U23

Steps to Reproduce:
1. Create a new Group Definition
2. Enter the following as the conditions

resource.grandParent.trait[Trait.hostname].contains = stage
resource.parent.type.plugin = JBossAS5
resource.type.name = Web Application (WAR)
resource.trait[contextRoot] = jmx-console

Note: just using the jmx-console as an example, it won't matter what the context root is (unless it is blank because / as context root is not handled and throws the following syntax error:

Syntax error in your group definition: Expression must be in one of the follow forms: 'groupBy condition', 'condition = value', 'empty condition', 'not empty condition 

)

3. Save group
4. Calculate group members
  
Actual results:
In the UI:
There was a problem calculating the results: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg2] 

In the Log: 
ERROR [org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerBean] Error recalculating DynaGroups for GroupDefinition[id=10011]
javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg2]

see attached for relevant stack trace


Expected results:
Find all deployed jmx-console Web Applications for JBossAS 5 profiles on servers with "stage" in the hostname

Additional info:
It will find all Web Applications for JBossAS 5 profiles on servers with "stage" in the hostname if I remove the last line - so I think the condition is valid.

This also occurs when other group definitions with more than one trait in the conditions.
Comment 2 John Sanda 2012-08-06 10:41:22 EDT
Changes and fixes have been pushed to the release/jon3.1.x branch.

commit hashes:
501156607c9
29eee0d0559f
17a3b79efa5
f4212820d19
Comment 3 Gary Lamperillo 2012-08-06 18:37:46 EDT
Does 3.1.x mean it is targeted for 3.1.1?
Comment 4 John Sanda 2012-08-07 09:17:47 EDT
Yes it it targeted for the 3.1.1 release. You will also see this in the target release field above.
Comment 5 John Sanda 2012-08-13 22:16:46 EDT
Moving to ON_QA since JON 3.1.1 ER2 build is availble - https://brewweb.devel.redhat.com/buildinfo?buildID=228250
Comment 6 Filip Brychta 2012-08-21 07:58:43 EDT
Verified on JON 3.1.1 ER2. Tried a few illegal expressions (multiple conditions of the same type) and checked UI error messages.

Note You need to log in before you can comment on or make changes to this bug.