Bug 835955 - dynagroup definition cannot contain both plugin configuration and resource configuration expressions
dynagroup definition cannot contain both plugin configuration and resource co...
Status: CLOSED DUPLICATE of bug 667896
Product: RHQ Project
Classification: Other
Component: Resource Grouping (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity high (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 12:25 EDT by John Sanda
Modified: 2012-07-02 13:24 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-02 13:24:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description John Sanda 2012-06-27 12:25:35 EDT
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 13:24:32 EDT
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.