Defining in the DynaGroup Expression builder: Resource = Resource ExpressionType = Resource Definiing Plugin = MetaMatrixPlugin ResourceType = MetaMatrix Process PropertyNames = id Comparison Type = '=' resource.id.startsWith = MetaMatrix System Select Calculate groups and the message displays: There was a problem calculating the results: java.lang.ClassCastException: java.lang.String In the server log, the following stack trace: 2008-08-21 09:25:41,557 INFO [org.hibernate.type.IntegerType] could not bind value 'MetaMatrix System%' to parameter: 1; java.lang.String 2008-08-21 09:25:41,557 ERROR [org.rhq.enterprise.gui.definition.group.EditGroupDefinitionGeneralPropertiesUIBean] There was a problem calculating the results: javax.ejb.EJBException: java.lang.ClassCastException: java.lang.String at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77) at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214) at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184) at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81) at $Proxy245.calculateGroupMembership(Unknown Source) at org.rhq.enterprise.gui.definition.group.EditGroupDefinitionGeneralPropertiesUIBean.createGroups(EditGroupDefinitionGeneralPropertiesUIBean.java:156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
I don't know if this is it but "Definiing Plugin = MetaMatrixPlugin" doesnt look right, try "Defining Plugin = MetaMatrixPlugin"
van, i notice that the expression builder created an expression of "resource.id.startsWith = MetaMatrix System" however, resource.id as an integer field, and you're trying to compare it to a non-integer value of "MetaMatrix System". you should notice that when you choose "Resource" as the expression type, that the defining plugin and resource type are grayed out. that's because they aren't relevant for that particular expression type. id is an integer type and so only the '=' operation is valid. startswith, endswith, and contains are string methods that will only match on string expressions. i'm accepting this, but only as a way to track the need to display a better error message instead of blowing up with a stack trace.
rev1303 - show a much more specific and relevant error when fields are compared to values of incompatible type, or when string functions are used on non-string fields;
rev1385, i tried the expression: resource.id.startsWith = MetaMatrix System and when i clicked "Calculate Groups", i got an errorblock "Probable syntax error: this is likely due to comparing an integer property of resource (such as id) to a non-numeric, or using a string function (startswith, endswith, or contains) on an integer property" which is more than sufficient to tell the user what they did wrong.
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-747