Red Hat Bugzilla – Bug 826716
Calculating Dynamic Group with more than one trait in Group Definition fails with QueryParameterException: could not locate named parameter
Last modified: 2013-09-11 06:59:29 EDT
+++ This bug was initially created as a clone of Bug #667896 +++
Created attachment 472190 [details]
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):
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
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
Find all deployed jmx-console Web Applications for JBossAS 5 profiles on servers with "stage" in the hostname
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.
Changes and fixes have been pushed to the release/jon3.1.x branch.
Does 3.1.x mean it is targeted for 3.1.1?
Yes it it targeted for the 3.1.1 release. You will also see this in the target release field above.
Moving to ON_QA since JON 3.1.1 ER2 build is availble - https://brewweb.devel.redhat.com/buildinfo?buildID=228250
Verified on JON 3.1.1 ER2. Tried a few illegal expressions (multiple conditions of the same type) and checked UI error messages.