Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/session/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drools-使用RuleNameEndsWithAgendaFilter时的ClassCastException_Drools - Fatal编程技术网

Drools-使用RuleNameEndsWithAgendaFilter时的ClassCastException

Drools-使用RuleNameEndsWithAgendaFilter时的ClassCastException,drools,Drools,下面是我正在使用的代码片段: AgendaFilter filter = (AgendaFilter) new RuleNameEndsWithAgendaFilter("Test"); // Gives a compile time error if I don't cast it. // Run the rules int numOfRulesFired = stateFulKnowledgeSession.fireAllRules(filter); 这会引发运行时异常: java.lan

下面是我正在使用的代码片段:

AgendaFilter filter = (AgendaFilter) new RuleNameEndsWithAgendaFilter("Test");
// Gives a compile time error if I don't cast it.
// Run the rules
int numOfRulesFired = stateFulKnowledgeSession.fireAllRules(filter);
这会引发运行时异常:

java.lang.ClassCastException: org.drools.base.RuleNameEndsWithAgendaFilter cannot be cast to org.drools.runtime.rule.AgendaFilter
如果我遗漏了什么,请告诉我

谢谢,
Ashwin

看起来您的
AgendaFilter
错误。我检查了最新的Drools代码,并且
org.Drools.runtime.rule.AgendaFilter
不再存在,或者被重命名为更好的名称

使用org.drools.spi.AgendaFilter