It could be an error in the DSL file. Check for errors after *each*
builder.add(...).
-W
2011/3/4 Saleem Lakhani <Saleem.Lakhani(a)citizensfla.com>:
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.getDrlSource()));
//ruleset.getDrlSource() = com/cit/myDrl.dslr
Reader dslSource = new
InputStreamReader(RVEngine.class.getResourceAsStream(ruleset.getDslSource()));
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(PackageBuilder.java:830)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:555)
at
org.drools.compiler.PackageBuilder.addPackageFromDslr(PackageBuilder.java:355)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:461)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
saleem
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users