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:
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 ***