Still getting an EvalConditionNode ClassCastException
by Paul Ryan
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/jav... 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
14 years, 6 months
Drools 5.1.0CR1
by Juan Ignacio Barisich
Hello everyone.
I'm working on a research about migration from OSWorklow to DroolsFlow.
Among other things, I need spring integration support. As I know, this
feature will be supported in the 5.1.0CR1 version of Drools. Do you know
when this version will be released? On
https://jira.jboss.org/browse/JBRULESthere isn't an expected date for
this version.
Thanks in advance.
Juan Barisich
14 years, 6 months
Handling Many Literal Matches Rules
by rodih
Hi,
I have the following scenario:
List 1 of string values: "A", "B", "C"
List 2 of string values: "X", "Y", "Z"
Some text that might look like "AFFG DDGT AY FDD" (Important value in the
text is AY)
I need a rule for every string value from List 1 combined with every value
from List 2 for example:
rule
when text matches "AX"
then
end rule
rule
when text matches "AY"
then
end rule
rule
when text matches "AZ"
then
end rule
rule
when text matches "BX"
then
end rule
rule
when text matches "BY"
then
end rule
...
You get the idea ;-)
The lists might be big (50 entries each) and will be change constantly out
side the application.
What is the best approach for this kind of rules?
Thanks,
Rod
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Handling-Many-Literal...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Drools error while adding knowledge base
by sandillio sandy
Hello Drools team,
when I am trying to run the drools project in eclipse I am getting the
error below. I am using Drools 5.0.1 and eclipse 3.4.2. I am trying to run
the example in the given link.
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/t...
I have everything installed correctly but still getiing the errors. I have
added the libraries in the lib directory of drools 5.0-bin. and the jar
files in this directory. and the drools drools-api-5.0.1.jar but still
gettinng the error below.
java.lang.NoSuchMethodError:
org.drools.compiler.PackageBuilder.addKnowledgeResource(Lorg/drools/io/Resource;Lorg/drools/builder/ResourceType;Lorg/drools/builder/ResourceConfiguration;)V
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.sample.RuleFlowTest.readKnowledgeBase(RuleFlowTest.java:38)
at com.sample.RuleFlowTest.main(RuleFlowTest.java:24)
Can you please help me out.
Regards,
Sandy
14 years, 6 months