You might try this:<br><br>     Properties props = new Properties();<br>     props.put( &quot;drools.dialect.java.compiler&quot;, &quot;JANINO&quot; );<br><br>    KnowledgeBuilderConfiguration kbConfig =<br>        KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration( props, (ClassLoader[]) null );<br>
<br>Requires the janino jar in your classpath, which I have as<br>   ~/.m2/repository/janino/janino/2.5.15/janino-2.5.15.jar<br><br>-W<br><br><div class="gmail_quote">On 9 June 2011 10:29, Abhay B. Chaware <span dir="ltr">&lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I am using drools 5.1.0<br>
<br>
Let me explain what I am trying to do.  I am trying to write a drools app on to android platform.  In my app, I have added following jars in the application classpath -<br>
<br>
antlr-runtime.jar<br>
drools-api.jar<br>
drools-compiler.jar<br>
drools-core.jar<br>
mvel2.jar<br>
<br>
Do I need any other jar files ?<br>
<br>
upon drilling down into the Null Pointer Exception, it appears that it is throwing NPE at following line inside RuleBuilder.java<br>
<br>
<br>
    RuleConditionBuilder builder = (RuleConditionBuilder)context.getDialect().getBuilder(ruleDescr.getLhs().getClass());<br>
<br>
and on further drilling, I found that &quot;context.getDialect()&quot; is retuning NULL.<br>
<br>
Then I put some debug inside PackageBuilder.java<br>
<br>
upon drilling down for the error, found out that it is not able to set the context&#39;s dialect.<br>
ctr.getDialect(pkgRegistry.getDialect()) gives &quot;null&quot; ...<br>
<br>
DialectCompiletimeRegistry ctr = pkgRegistry.getDialectCompiletimeRegistry();<br>
RuleBuildContext context = new RuleBuildContext(this, ruleDescr, ctr, pkg, ctr.getDialect(pkgRegistry.getDialect()));<br>
<br>
Is there any default setting /configuration that I am obviously missing ?<br>
<br>
what could be the problem ?<br>
<br>
-abhay<br>
<br>
<br>
________________________________________<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Swindells, Thomas [<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>]<br>

Sent: Thursday, June 09, 2011 1:40 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
<div><div></div><div class="h5"><br>
Which version of drools is this?<br>
For drools 5.0.1 we just use maven to resolve the dependencies for us and it works fine. I can&#39;t obviously see any eclipse compiler in the jars that we distribute with our application.<br>
<br>
Thomas<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-">rules-users-</a><br>
&gt; <a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>] On Behalf Of Abhay B. Chaware<br>
&gt; Sent: 09 June 2011 08:06<br>
&gt; To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; Subject: [rules-users] Drools in non-eclipse environment<br>
&gt;<br>
&gt; Has anyone tried using drools in non-eclipse env ? meaning that<br>
&gt; org.eclipse.jdt.core_3.5.1.v_972_R35x.jar is not in the classpath ?<br>
&gt;<br>
&gt; Documentation says this :<br>
&gt;<br>
&gt; (<a href="http://docs.huihoo.com/drools/4.0.7/ch02s05.html" target="_blank">http://docs.huihoo.com/drools/4.0.7/ch02s05.html</a>)<br>
&gt;<br>
&gt; if you do not have Eclipse JDT Core in your classpath you must override the<br>
&gt; compiler setting before you instantiate this PackageBuilder, you can either<br>
&gt; do that with a packagebuilder properties file the ChainedProperties class will<br>
&gt; find, or you can do it programmatically as shown below; note this time I use<br>
&gt; properties to inject the value for startup.<br>
&gt;<br>
&gt; They also provide an example, but I am not able to figure out exactly how to<br>
&gt; use this example/info.<br>
&gt;<br>
&gt; Here is my code :<br>
&gt;<br>
&gt;               KnowledgeBuilder kbuilder =<br>
&gt; KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
&gt;               kbuilder.add(ResourceFactory.newInputStreamResource(is),<br>
&gt; ResourceType.DRL);<br>
&gt;<br>
&gt; where &quot;is&quot; is input stream containing the rule file ( .drl)<br>
&gt;<br>
&gt; How do I override the compiler setting ?<br>
&gt;<br>
&gt; I am getting a null pointer exception ( see below ) and I suspect that<br>
&gt; overriding the packagebuilderconfiguration will fix it ?<br>
&gt;<br>
&gt; W/System.err(25511): java.lang.NullPointerException<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java<br>
&gt; :267)<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder<br>
&gt; .java:459)<br>
&gt; W/System.err(25511):    at<br>
&gt; org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.ja<br>
&gt; va:28)<br>
&gt; W/System.err(25511):    at<br>
&gt; com.ts.DBconnector.readKnowledgeBase(DBconnector.java:146)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com">postmaster@nds.com</a> 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.<br>

<br>
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<br>
**************************************************************************************<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>