简体   繁体   English

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

[英]drools plugin in Eclipse Sample.drl shows errors

I am new with Drools. 我是Drools的新人。 I use drools plugin (6.4.0.Final) in Eclipse Neon. 我在Eclipse Neon中使用drools插件(6.4.0.Final)。 I followed the wizard to create a drools project with some example files. 我按照向导创建了一个包含一些示例文件的drools项目。 After the steps were done, Eclipse highlighted errors at the two rules in the Sample.drl file. 完成这些步骤后,Eclipse突出显示了Sample.drl文件中两个规则的错误。 Here is one of the errors: 这是一个错误:

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

When I ran DroolsTest.java, I got the following error: 当我运行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)

It seems like an library path issue. 这似乎是一个库路径问题。 Any helps are appreciated. 任何帮助表示赞赏。

Thank you very much! 非常感谢你!

This is a bug in either Neon or drools plugin, it's fixed in drools plugin (6.5.0.Final) based on this site: jboss-issue-description 这是Neon或drools插件中的一个错误,它基于此站点在drools插件(6.5.0.Final)中修复: jboss-issue-description

But since I don't find 6.5.0.Final version released, you can fix this by degrade eclipse to Mars 但由于我没有发现6.5.0.Final版本发布,你可以通过降低eclipse到火星来解决这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM