[rules-dev] Drools on android -reply

Matthew Versaggi profversaggi at gmail.com
Mon Jan 2 08:56:45 EST 2012


Once it starts getting into the DX of the DRL rules to feed into Drools
it'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't look that way.....

**********************

On Mon, Jan 2, 2012 at 2:46 PM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> On 2 January 2012 14:30, Matthew Versaggi <profversaggi at 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've seen NPEs thrown up from down in the Drools gears when the DRL
> resource could not be found. Make sure that
>    ResourceFactory.newClassPathResource("HelloWorld.drl",
> DroolsTest.class)
>
> is != null.
>
> 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."
>>
>
> Yes, that'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.)
>
> -W
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20120102/8a9caab5/attachment.html 


More information about the rules-dev mailing list