Bug 835955 - dynagroup definition cannot contain both plugin configuration and resource configuration expressions
Summary: dynagroup definition cannot contain both plugin configuration and resource co...
Keywords:
Status: CLOSED DUPLICATE of bug 667896
Alias: None
Product: RHQ Project
Classification: Other
Component: Resource Grouping
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-27 16:25 UTC by John Sanda
Modified: 2012-07-02 17:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-02 17:24:32 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 667896 0 high CLOSED Calculating Dynamic Group with more than one trait in Group Definition Condition causes Hibernate Exception 2021-02-22 00:41:40 UTC
Red Hat Bugzilla bug 0 None None None Never

Internal Links: 499109 667896

Description John Sanda 2012-06-27 16:25:35 UTC
Description of problem:
This issue is related to bug 667896. I want to track it separately though because I think this issue can be resolved independent of 667896. If you attempt to create a dynagroup definition that contains both plugin configuration and resource configuration expressions, an exception is thrown that looks like,

Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: Duplicate definition of alias 'simple'

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


How reproducible:
always


Steps to Reproduce:
1. Log into RHQ server
2. Go to create a new dynagroup definition
3. Add a plugin configuration expression, e.g., resource.pluginConfiguration[x] = foo
4. Add a resource configuration expression, e.g., resource.resourceConfiguration[y] = bar
5. Click the "Save and Recalculate" button
  
Actual results:
Exception is thrown and reported in server in message center. The error in the message center is something like:

org.hibernate.hql.ast.QuerySyntaxException:Duplicate definition of alias 'simple' [SELECT res.id FROM org.rhq.core.domain.resource.Resource res JOIN res.childResources child JOIN res.pluginConfiguration pluginConf, org.rhq.core.domain.configuration.PropertySimple simple, org.rhq.core.domain.configuration.definition.PropertyDefinition simpleDef JOIN res.resourceType.pluginConfigurationDefinition pluginConfDef JOIN child.resourceConfiguration conf, org.rhq.core.domain.configuration.PropertySimple simple, org.rhq.core.domain.configuration.definition.PropertyDefinition simpleDef JOIN child.resourceType.resourceConfigurationDefinition confDef WHERE simple.name LIKE :arg3 ESCAPE '\' AND simple.stringValue = :arg4 AND res.inventoryStatus = org.rhq.core.domain.resource.InventoryStatus.COMMITTED AND simple.configuration = pluginConf AND simpleDef.configurationDefinition = pluginConfDef AND simple.name = simpleDef.name AND simpleDef.type != 'PASSWORD' AND simple.configuration = conf AND simpleDef.configurationDefinition = confDef]

Expected results:
A valid JPQL query should be generated.

Additional info:

Comment 1 John Sanda 2012-07-02 17:24:32 UTC
It turns out that this really is the same issue as in bug 667896. Even though we are dealing with different expression types, we are querying the same set tables. I am going to close this as a duplicate.

*** This bug has been marked as a duplicate of bug 667896 ***


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