[rules-users] Still getting an EvalConditionNode ClassCastException

Paul Ryan pryan at infotrustgroup.com
Tue Jul 20 16:48:20 EDT 2010


We're only seeing it on a customer customization so I'm a little hesitant to put out the SNAPSHOT to them, I will try though. Do you know what the plan is for releasing 5.1.0 or at least a 5.1.0.M3?


At the very least I'll try to make a test case I can get to repeat in dev.

-- Paul Ryan

On Jul 20, 2010, at 12:17 PM, Edson Tirelli wrote:

    Paul,

    Did you tried trunk?

    The source of this problem was not in the EvalNode class itself (that is why you mention the code is still there), but on the re-use of node ids, that determine the position of the node memory in the memory array. I fixed this in trunk a few weeks ago. Give it a try and let me know if you still see any problem, but I think it is everything fine now.

https://jira.jboss.org/browse/JBRULES-2312

    Thanks,
         Edson


2010/7/20 Paul Ryan <pryan at infotrustgroup.com<mailto:pryan at infotrustgroup.com>>
We're still getting a class cast exception for beta and eval memory (exception below). It is a different location and the opposite direction of the exception cast from JBRULES-1719.

The rule we ran was:

/**
* Load the smgl transform
*/
rule "Load Transform"
when
  $fact : ParametersFact(
           doc != "dmodule",
           $xml : xml != null,
           noopResponse == true,
   eval(XPathUtil.selectElement($xml,"/*/transformLog//transform[name='s1000dv3']")==null),
   flags['loadedS1000Dv3']!=true,
   eval(XPathUtil.selectElement($xml,"/*/transformLog//transform[name='detect']/results[result='text/xml']")!=null)
   )
   $importUtil : RuleImportUtil()
   $model : EditionsRulesJobRunner(stop==false,interrupt==false)
then

   Vector<String> libraries = new Vector<String>();
   libraries.add("lib");
   String documentType = "dmodule";
   String fragmentType = "dmodule";

   $importUtil.importRules(kcontext,"transformCmd",documentType,fragmentType,libraries);
   $fact.getFlags().put("loadedS1000Dv3",true);
end

The thing of consequence here is the importRules call which modifies the kcontext and acts as a dynamic include (e.g. it imports new rules).

The exception received is:

INFO   | 2010/07/19 17:07:29 | jvm 1    | 2010-07-19 17:07:29,743  INFO com.infotrustgroup.restless.server.ThreadedService:An exception was trapped in com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner
INFO   | 2010/07/19 17:07:29 | jvm 1    | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at java.lang.reflect.Method.invoke(Method.java:597)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.restless.server.ThreadedService.runServiceMethod(ThreadedService.java:845)
INFO   | 2010/07/19 17:07:29 | jvm 1    | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO   | 2010/07/19 17:07:29 | jvm 1    | ... 16 more
INFO   | 2010/07/19 17:07:29 | jvm 1    | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at java.lang.reflect.Method.invoke(Method.java:597)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.restless.server.ThreadedService.runServiceMethod(ThreadedService.java:845)
INFO   | 2010/07/19 17:07:29 | jvm 1    | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO   | 2010/07/19 17:07:29 | jvm 1    | ... 16 more
INFO   | 2010/07/19 17:07:29 | jvm 1    | 2010-07-19 17:07:29,759 FATAL com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner:Worker service threw an unexpected exception.
INFO   | 2010/07/19 17:07:29 | jvm 1    | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO   | 2010/07/19 17:07:29 | jvm 1    | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO   | 2010/07/19 17:07:29 | jvm 1    | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO   | 2010/07/19 17:07:29 | jvm 1    | ... 11 more

Point of speculation:

When looking at the latest code on trunk I would believe this is not fixed as the line pointed to here has not changed (the place where this line exists has changed but not the code see fisheye at http://fisheye.jboss.org/browse/JBossRules/trunk/drools-core/src/main/java/org/drools/reteoo/EvalConditionNode.java?r1=23650&r2=34068&u=20 and where the lefthand side was 199 for 5.0.1 it is still the same code in the latest svn revision (now line 229).
-- Paul Ryan


_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com<http://www.jboss.com/>
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100720/f5bf8884/attachment.html 


More information about the rules-users mailing list