Hello,
I get the following Nullpointer exception when building the package:
java.lang.NullPointerException
at org.drools.rule.AbstractCompositeRestriction.getRequiredDeclarations(AbstractCompositeRestriction.java:29)
at org.drools.rule.MultiRestrictionFieldConstraint.getRequiredDeclarations(MultiRestrictionFieldConstraint.java:27)
at org.drools.rule.Pattern.setConstraintType(Pattern.java:279)
at org.drools.rule.Pattern.addConstraint(Pattern.java:157)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:340)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:199)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:168)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:93)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:53)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
at com.dssrules.RuleEngineAdapter.initRuleBase(RuleEngineAdapter.java:71)
at com.dssrules.TestRuleEngineAdapter.main(TestRuleEngineAdapter.java:17)
Exception in thread "main" java.lang.NullPointerException
at com.dssrules.RuleEngineAdapter.insert(RuleEngineAdapter.java:42)
at com.dssrules.TestRuleEngineAdapter.main(TestRuleEngineAdapter.java:35)
Debugging shows the programm get stuck in this line (the resource drl-file was found):
builder0.addPackageFromDrl(new InputStreamReader(resource.getInputStream()));
I have further the error message: Missing package name for rule package." Although the package declaration in the drl-file should be ok, it worked in the previous drl version. I don't know why it doesn't work anymore.
Regards
Thomas