Has anyone tried using drools in non-eclipse env ? meaning that
org.eclipse.jdt.core_3.5.1.v_972_R35x.jar is not in the classpath ?
Documentation says this :
(
http://docs.huihoo.com/drools/4.0.7/ch02s05.html)
if you do not have Eclipse JDT Core in your classpath you must override the compiler
setting before you instantiate this PackageBuilder, you can either do that with a
packagebuilder properties file the ChainedProperties class will find, or you can do it
programmatically as shown below; note this time I use properties to inject the value for
startup.
They also provide an example, but I am not able to figure out exactly how to use this
example/info.
Here is my code :
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newInputStreamResource(is), ResourceType.DRL);
where "is" is input stream containing the rule file ( .drl)
How do I override the compiler setting ?
I am getting a null pointer exception ( see below ) and I suspect that overriding the
packagebuilderconfiguration will fix it ?
W/System.err(25511): java.lang.NullPointerException
W/System.err(25511): at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)
W/System.err(25511): at
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)
W/System.err(25511): at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)
W/System.err(25511): at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:267)
W/System.err(25511): at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:459)
W/System.err(25511): at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
W/System.err(25511): at com.ts.DBconnector.readKnowledgeBase(DBconnector.java:146)