[rules-users] Drools in non-eclipse environment

Swindells, Thomas TSwindells at nds.com
Thu Jun 9 04:10:48 EDT 2011


Which version of drools is this?
For drools 5.0.1 we just use maven to resolve the dependencies for us and it works fine. I can't obviously see any eclipse compiler in the jars that we distribute with our application.

Thomas

> -----Original Message-----
> From: rules-users-bounces at lists.jboss.org [mailto:rules-users-
> bounces at lists.jboss.org] On Behalf Of Abhay B. Chaware
> Sent: 09 June 2011 08:06
> To: rules-users at lists.jboss.org
> Subject: [rules-users] Drools in non-eclipse environment
>
> 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.ja
> va:28)
> W/System.err(25511):    at
> com.ts.DBconnector.readKnowledgeBase(DBconnector.java:146)
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster at nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************




More information about the rules-users mailing list