Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.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
Java Eclipse Sample.drl中的drools插件显示错误_Java_Eclipse_Drools - Fatal编程技术网

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

Java Eclipse Sample.drl中的drools插件显示错误,java,eclipse,drools,Java,Eclipse,Drools,我是个流口水的新手。我在EclipseNeon中使用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.AllS

我是个流口水的新手。我在EclipseNeon中使用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插件中的一个bug,它在drools插件(6.5.0.Final)中修复,基于此站点:


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

这是Neon或drools插件中的一个错误,drools插件(6.5.0.Final)基于此网站修复了此错误:


但是由于我没有找到发布的6.5.0.Final版本,您可以通过将eclipse降级到火星来解决这个问题

看起来您的导入语句不正确
com.sample.DroolsTest.Message解析为一个包
意味着您需要
import com.sample.DroolsTest.Message.*
取而代之的是?sample.drl是在向导之后生成的。我没有改变任何事情。按照建议更改导入后,我又遇到了一个错误:BuildError:无法解析ObjectType'Message',我通过在Sample.drl中的两个规则中添加方言“mvel”修复了这个问题。示例中缺少方言,这是drools向导中的一个bug吗?或者它假设在没有方言的情况下工作?谢谢。我将Eclipse降级为Mars2,并重新安装了插件。现在可以了。谢谢。看来您的导入语句不正确
com.sample.DroolsTest.Message解析为一个包
意味着您需要
import com.sample.DroolsTest.Message.*
取而代之的是?sample.drl是在向导之后生成的。我没有改变任何事情。按照建议更改导入后,我又遇到了一个错误:BuildError:无法解析ObjectType'Message',我通过在Sample.drl中的两个规则中添加方言“mvel”修复了这个问题。示例中缺少方言,这是drools向导中的一个bug吗?或者它假设在没有方言的情况下工作?谢谢。我将Eclipse降级为Mars2,并重新安装了插件。现在可以了。谢谢