我是Drools的新人。我在Eclipse Neon中使用drools插件(6.4.0.Final)。我按照向导创建了一个包含一些示例文件的drools项目。完成这些步骤后,Eclipse突出显示了Sample.drl文件中两个规则的错误。以下是其中一个错误:
Multiple markers at this line
com.sample.DroolsTest.Message cannot be resolved to a type
org.drools.core.util.bitmask.AllSetBitMask cannot be resolved to a type
Only a type can be imported. com.sample.DroolsTest.Message resolves to a package
org.kie.api.runtime.rule.FactHandle cannot be resolved to a type
KnowledgeHelper cannot be resolved to a type
Only a type can be imported. org.drools.core.spi.KnowledgeHelper resolves to a package
Message.GOODBYE cannot be resolved to a type
org.kie.api.runtime.rule.RuleContext cannot be resolved to a type
java.lang.Exception cannot be resolved to a type
当我运行DroolsTest.java时,我收到以下错误:
java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=Sample.drl, line=15, column=0
text=Rule Compilation error Only a type can be imported. com.sample.DroolsTest.Message resolves to a package
Only a type can be imported. org.drools.core.spi.KnowledgeHelper resolves to a package
KnowledgeHelper cannot be resolved to a type
org.kie.api.runtime.rule.FactHandle cannot be resolved to a type
java.lang.Exception cannot be resolved to a type
org.kie.api.runtime.rule.RuleContext cannot be resolved to a type], Message [id=2, level=ERROR, path=Sample.drl, line=5, column=0
text=Rule Compilation error Only a type can be imported. com.sample.DroolsTest.Message resolves to a package
Only a type can be imported. org.drools.core.spi.KnowledgeHelper resolves to a package
KnowledgeHelper cannot be resolved to a type
com.sample.DroolsTest.Message cannot be resolved to a type
org.kie.api.runtime.rule.FactHandle cannot be resolved to a type
org.kie.api.runtime.rule.FactHandle cannot be resolved to a type
java.lang.Exception cannot be resolved to a type
org.kie.api.runtime.rule.RuleContext cannot be resolved to a type
Message.GOODBYE cannot be resolved to a type
org.drools.core.util.bitmask.AllSetBitMask cannot be resolved to a type
com.sample.DroolsTest.Message cannot be resolved to a type]]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:450)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:604)
at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:575)
这似乎是一个库路径问题。任何帮助都表示赞赏。
非常感谢!
答案 0 :(得分:0)
这是Neon或drools插件中的错误,它已根据此网站在drools插件(6.5.0.Final)中修复:jboss-issue-description
但由于我没有发现6.5.0.Final版本,你可以通过降低日食到火星来解决这个问题