gpt4 book ai didi

java - Eclipse Sample.drl 中的 drools 插件显示错误

转载 作者:太空宇宙 更新时间:2023-11-04 12:20:42 27 4
gpt4 key购买 nike

我是 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)

这似乎是一个库路径问题。如有任何帮助,我们将不胜感激。

非常感谢!

最佳答案

这是 Neon 或 drools 插件中的一个错误,它已在基于此站点的 drools 插件 (6.5.0.Final) 中修复:jboss-issue-description

但是由于我没有找到 6.5.0.Final 版本发布,您可以通过将 eclipse 降级到火星来修复此问题

关于java - Eclipse Sample.drl 中的 drools 插件显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38879090/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com