]
Sarit Adhikari commented on DROOLS-1250:
----------------------------------------
I am facing the same issue. But the code runs fine despite compile time error. Also the
error message makes no sense. Why does it say com.sample.DroolsTest.Message resolves to a
package when it clearly isn't.
Drools Sample.drl is broken
---------------------------
Key: DROOLS-1250
URL:
https://issues.jboss.org/browse/DROOLS-1250
Project: Drools
Issue Type: Feature Request
Components: eclipse plugin
Affects Versions: 6.4.0.Final
Reporter: Tianwei Chen
Assignee: Robert (Bob) Brodt
Hello, I use drools plugin (6.4.0.Final) in Eclipse Neon. I followed the wizard to create
a drools project with some example files. After the step were done, Eclipse highlighted
errors at the two rules in the Sample.drl file. 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:
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. Please help!
Thank you very much!
Tianwei Chen