Saving a DynaGroup expression which uses two or more trait metrics fails with QueryParameterException: could not locate named parameter

Solution Verified - Updated -

Issue

  • Dynamic group creation error
  • Dynamic group definition fails to save with the following error:

    There was a problem calculating the results: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg1]
    
  • Using two or more traits in a DynaGroup definition expression results in the following exception:

    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]
        at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
        at $Proxy259.recalculateDynaGroups(Unknown Source)
        ...
        at org.rhq.enterprise.server.scheduler.jobs.DynaGroupAutoRecalculationJob.executeJobCode(DynaGroupAutoRecalculationJob.java:42)
        at org.rhq.enterprise.server.scheduler.jobs.AbstractStatefulJob.execute(AbstractStatefulJob.java:48)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg2]
        at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:176)
        at org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator.getSingleResultList(ExpressionEvaluator.java:939)
        at org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator.access$300(ExpressionEvaluator.java:45)
        at org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator$SingleQueryIterator.next(ExpressionEvaluator.java:784)
        at org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator$SingleQueryIterator.next(ExpressionEvaluator.java:774)
        at org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerBean.calculateGroupMembership(GroupDefinitionManagerBean.java:286)
        ...
    Caused by: org.hibernate.QueryParameterException: could not locate named parameter [arg2]
        at org.hibernate.engine.query.ParameterMetadata.getNamedParameterDescriptor(ParameterMetadata.java:75)
        at org.hibernate.engine.query.ParameterMetadata.getNamedParameterExpectedType(ParameterMetadata.java:81)
        ...
    
  • Save and Recalculate DynaGroup expression fails with the following error message:

    javax.ejb.EJBException:java.lang.IllegalArgumentException: org.hibernate.QueryParameterException: could not locate named parameter [arg2] -> java.lang.IllegalArgumentException:org.hibernate.QueryParameterException: could not locate named parameter [arg2] -> org.hibernate.QueryParameterException:could not locate named parameter [arg2]
    

Environment

  • JBoss Operations Network (JON) 2.4.1, 3.0, 3.0.1, 3.1.0
  • JON DynaGroup Definition with two or more Trait metrics specified

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In