On 2 January 2012 14:30, Matthew Versaggi <profversaggi@gmail.com> wrote:
Here's what I got working and when it failed .... it was just the basic 'hello world' kind of stuff:
Worked:
final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
Died:
// this will parse and compile in one step
kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl", DroolsTest.class), ResourceType.DRL);
LogCat:
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
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:
"A small modification is needed in org.drools.util.CompositeClassLoader. Apparently, the Android JVM doesn't allow null as the parent classloader so I changed that to super(CompositeClassLoader.class.getClassLoader()) in the constructor, and that works fine."