Following is my code:
KnowledgeBuilderConfiguration kbc =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();
kbc.setProperty("drools.dialect.java.compiler", "JANINO");
KnowledgeBuilder builder = null;
builder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbc);
Reader drlSource = new
InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDrlSourc
e())); //ruleset.getDrlSource() = com/cit/myDrl.dslr
Reader dslSource = new
InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDslSourc
e()));
builder.add(ResourceFactory.newReaderResource(dslSource),
ResourceType.DSL);
builder.add(ResourceFactory.newReaderResource(drlSource),
ResourceType.DSLR);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(builder.getKnowledgePackages());
no matter what I type in my dslr (drl) file I get the following
exception on the highlighted line; ANY IDEA????
I have 1 rule or No rule it still throws the same exception. Does it
have to do with any jar files?
Caused by: java.lang.NullPointerException
at
org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilde
r.java:830)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:555)
at
org.drools.compiler.PackageBuilder.addPackageFromDslr(PackageBuilder.jav
a:355)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.j
ava:461)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja
va:28)
saleem