Once it starts getting into the DX of the DRL rules to feed into Drools it&#39;s gets quickly past my experience level .... I had hoped for a clean do it all in one place kind of thing but it doesn&#39;t look that way.....<br>
<br>**********************<br><br><div class="gmail_quote">On Mon, Jan 2, 2012 at 2:46 PM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 2 January 2012 14:30, Matthew Versaggi <span dir="ltr">&lt;<a href="mailto:profversaggi@gmail.com" target="_blank">profversaggi@gmail.com</a>&gt;</span> wrote:<br></div><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

Here&#39;s what I got working and when it failed .... it was just the basic &#39;hello world&#39; kind of stuff:<br><br>Worked:<br>final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();<br><br>Died: <br>



// this will parse and compile in one step<br>kbuilder.add(ResourceFactory.newClassPathResource(&quot;HelloWorld.drl&quot;, DroolsTest.class), ResourceType.DRL);<br><br>LogCat:<br>01-02 13:13:17.684: E/AndroidRuntime(537): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.versaggi.android.droolsandroidtest/com.versaggi.android.droolsandroidtest.DroolsAndroidTestActivity}: java.lang.NullPointerException<br>



<br></blockquote></div><div><br>I&#39;ve seen NPEs thrown up from down in the Drools gears when the DRL resource could not be found. Make sure that<br>   ResourceFactory.newClassPathResource(&quot;HelloWorld.drl&quot;,         DroolsTest.class) <br>


<br>is != null.<br><br></div><div class="im"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">I had to re-compile the CompositeClassLoader.java file and then reinsert it into the drools-api-5.1.0.M2.jar file to get past this issue:<br>


<br>&quot;A small modification is needed in <span style="font-style:italic">org.drools.util.CompositeClassLoader</span>.  Apparently, the Android JVM doesn&#39;t allow <span style="font-style:italic">null</span> as the parent classloader so I changed that to <span style="font-style:italic">super(CompositeClassLoader.class.getClassLoader())</span> in the constructor, and that works fine.&quot;<br>


</blockquote></div><div><br>Yes, that&#39;s come up in other Java environments as well, and IIRC been fixed on the way towards 5.2.0. )There ought to be a closed JIRA, if s.o. cares to look it up.)<span class="HOEnZb"><font color="#888888"><br>
<br>-W<br><br>
</font></span></div></div>
<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>