Bug 826716 - Calculating Dynamic Group with more than one trait in Group Definition fails with QueryParameterException: could not locate named parameter
Summary: Calculating Dynamic Group with more than one trait in Group Definition fails ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Resource Grouping
Version: JON 2.4.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: JON 3.1.1
Assignee: John Sanda
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 667896
Blocks: 837078
TreeView+ depends on / blocked
 
Reported: 2012-05-30 20:21 UTC by dsteigne
Modified: 2018-11-27 19:30 UTC (History)
5 users (show)

Fixed In Version:
Clone Of: 667896
: 837078 (view as bug list)
Environment:
Last Closed: 2013-09-11 10:59:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description dsteigne 2012-05-30 20:21:12 UTC
+++ 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 14:41:22 UTC
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 22:37:46 UTC
Does 3.1.x mean it is targeted for 3.1.1?

Comment 4 John Sanda 2012-08-07 13:17:47 UTC
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-14 02:16:46 UTC
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 11:58:43 UTC
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.