How big is your knowledge base? You could start with few rules and facts, no?<br><br>If you re not already doing it, and you&#39;re creating several rules sessions (would be the case if you&#39;re doing stateless), you should try to cache your KBs as well and create new sessions from the cached KB(s). <br>
<br>Cheers,<br>Leo.<br><br><div class="gmail_quote">On Fri, Jun 17, 2011 at 4:17 AM, 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="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I tried that .. I was able to reproduce same crash on android emulator .. default heap is 24M ( like any android device ).  I tried raising it upto 400Mb in steps, but it failed everytime with same error .. but was able to sustain longer everytime i increase the heap. Seems that I can not go beyond 400m .. the emulator crashed !<br>

<br>
-abhay<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 Michael Anstis [<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>]<br>

Sent: Thursday, June 16, 2011 6:48 PM<br>
<div class="im">To: Rules Users List<br>
Subject: Re: [rules-users] FW: Drools in non-eclipse environment<br>
<br>
</div><div class="im">In a meeting right now, but you could try Googling for ways to increase the heap size on Android?<br>
<br>
I did a very quick search and it looked possible....<br>
<br>
</div>2011/6/16 Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt;<br>

<div class="im">Thanks Mike !<br>
It is failing after few seconds ( about 30-35 secs ) after I get the “Creating Package Builder ..” line on the console …I am not getting the next debug statement, but getting the exception instead. I am seeing a lot of garbage collection calls right after “Creating Package Builder …” line in the console before crashing, which tells me that the issue is probably related to heap/memory.<br>

Here’s the snippet from my code.<br>
                        System.out.println (“Creating Package Builder .. ”);<br>
                        PackageBuilder builder = new PackageBuilder( cfg0 );<br>
                        builder.addPackageFromDrl(new InputStreamReader(is)); // “is” is input stream for drl file<br>
                        RuleBase ruleBase  = RuleBaseFactory.newRuleBase();<br>
                        ruleBase.addPackage( builder.getPackage() );<br>
                        System.out.println (“Package added to rule base.. ”);<br>
-abhay<br>
________________________________<br>
</div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt; [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;] On Behalf Of Michael Anstis<br>

<div class="im">Sent: Thursday, June 16, 2011 6:17 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] FW: Drools in non-eclipse environment<br>
<br>
Congratulations Abhay!<br>
<br>
When does your application crash? e.g. building package, inserting facts, firing all rules?<br>
<br>
<br>
I&#39;m not sure how much help I can be, but your advice might help others.<br>
<br>
Unfortunately I&#39;m not able to analyse the Android log :(<br>
<br>
Cheers,<br>
<br>
Mike<br>
<br>
</div>2011/6/16 Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt;<br>

<div><div></div><div class="h5">I am have now managed to get past all the compiler errors for Drools on android .. ( I think ) ☺ .<br>
<br>
My app is failing ( crashing ) when run on android device. Looking at the log, appears to be a heap memory problem, can anyone see anything suspicious here in the android log, that may point to the drools code as suspect ?<br>

<br>
<br>
I/DEBUG ( 1280): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***<br>
I/DEBUG ( 1280): Build fingerprint: &#39;samsung/GT-I9003/GT-I9003/GT-I9003:2.2.1/FROYO/XXKB3:user/release-keys&#39;<br>
I/DEBUG ( 1280): pid: 11341, tid: 11341 &gt;&gt;&gt; com.first &lt;&lt;&lt;<br>
I/DEBUG ( 1280): signal 11 (SIGSEGV), fault addr 0000004c<br>
I/DEBUG ( 1280): r0 00000000 r1 4831de40 r2 00000000 r3 00000000<br>
I/DEBUG ( 1280): r4 809a2400 r5 00240d00 r6 00000000 r7 0000cd28<br>
I/DEBUG ( 1280): r8 80917040 r9 0000cd28 10 430cb970 fp bea15728<br>
I/DEBUG ( 1280): ip 00000000 sp bea153a8 lr 809681f7 pc 8096809c cpsr 80000070<br>
I/DEBUG ( 1280): d0 65643a64696f7262 d1 0065006400610075<br>
I/DEBUG ( 1280): d2 4ba11af200000567 d3 000000004b815b67<br>
I/DEBUG ( 1280): d4 0065007400730079 d5 00610050002e006d<br>
I/DEBUG ( 1280): d6 006c004300680074 d7 3eaaaaab3f800000<br>
I/DEBUG ( 1280): d8 0000000000000000 d9 0000000000000000<br>
I/DEBUG ( 1280): d10 0000000000000000 d11 0000000000000000<br>
I/DEBUG ( 1280): d12 0000000000000000 d13 0000000000000000<br>
I/DEBUG ( 1280): d14 0000000000000000 d15 0000000000000000<br>
I/DEBUG ( 1280): d16 ade4622100000000 d17 0064002f005b0072<br>
I/DEBUG ( 1280): d18 002f006100740061 d19 002f007000700061<br>
I/DEBUG ( 1280): d20 0073002e006b0069 d21 0065007400730079<br>
I/DEBUG ( 1280): d22 00610050002e006d d23 006c004300680074<br>
I/DEBUG ( 1280): d24 3ff0000000000000 d25 0000000000000000<br>
I/DEBUG ( 1280): d26 0000000000000000 d27 0000000000000000<br>
I/DEBUG ( 1280): d28 0000000000000000 d29 0000000000000000<br>
I/DEBUG ( 1280): d30 0000000000000000 d31 0000000000000000<br>
I/DEBUG ( 1280): scr 80000012<br>
I/DEBUG ( 1280):<br>
I/DEBUG ( 1280): #00 pc 0006809c /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #01 pc 000681f2 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #02 pc 00068238 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #03 pc 000690a6 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #04 pc 00061a0c /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #05 pc 00063f1a /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #06 pc 0001bdd8 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #07 pc 000227d4 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #08 pc 00021674 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #09 pc 0005c7d6 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #10 pc 00064ef8 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #11 pc 0001bdd8 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #12 pc 000227d4 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #13 pc 00021674 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #14 pc 0005c614 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #15 pc 00047cd6 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #16 pc 000364b4 /system/lib/libandroid_runtime.so<br>
I/DEBUG ( 1280): #17 pc 0003808c /system/lib/libandroid_runtime.so<br>
I/DEBUG ( 1280): #18 pc 00008ca8 /system/bin/app_process<br>
I/DEBUG ( 1280): #19 pc 0000d404 /system/lib/libc.so<br>
I/DEBUG ( 1280):<br>
I/DEBUG ( 1280): code around pc:<br>
I/DEBUG ( 1280): 8096807c 0f02f1be 2500bfd8 b0054628 bf00bdf0<br>
I/DEBUG ( 1280): 8096808c 0003a3c8 000003a0 fffc3f91 41f0e92d<br>
I/DEBUG ( 1280): 8096809c 4d216cc3 4606a200 18ad460f d0384299<br>
I/DEBUG ( 1280): 809680ac e078f8df 400ef855 208cf8d4 0014f112<br>
I/DEBUG ( 1280): 809680bc eb0cf7ae c094f8d4 f1bc6a73 bf180100<br>
I/DEBUG ( 1280):<br>
I/DEBUG ( 1280): code around lr:<br>
I/DEBUG ( 1280): 809681d4 461a9905 633e1820 fb12f7d9 46089902<br>
I/DEBUG ( 1280): 809681e4 f7e84639 e004faa7 99044610 f7ff4616<br>
I/DEBUG ( 1280): 809681f4 9803ff51 f7e82100 4628fa9d ed6af7ae<br>
I/DEBUG ( 1280): 80968204 b0094630 bf00bdf0 0003a2c8 fffe46a4<br>
I/DEBUG ( 1280): 80968214 ffff026e ffff1926 fffe2288 ffff194c<br>
I/DEBUG ( 1280):<br>
I/DEBUG ( 1280): stack:<br>
I/DEBUG ( 1280): bea15368 430faf80 /dev/ashmem/dalvik-LinearAlloc (deleted)<br>
I/DEBUG ( 1280): bea1536c 0000cd28 [heap]<br>
I/DEBUG ( 1280): bea15370 bea153c4 [stack]<br>
I/DEBUG ( 1280): bea15374 8095c61d /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea15378 8099266e /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea1537c 4831de40 /dev/ashmem/mspace/dalvik-heap/2 (deleted)<br>
I/DEBUG ( 1280): bea15380 439121ed /system/framework/core.odex<br>
I/DEBUG ( 1280): bea15384 00000000<br>
I/DEBUG ( 1280): bea15388 bea15340 [stack]<br>
I/DEBUG ( 1280): bea1538c 0000001f<br>
I/DEBUG ( 1280): bea15390 80993d3a /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea15394 809a2400 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea15398 00240d00 [heap]<br>
I/DEBUG ( 1280): bea1539c 00000000<br>
I/DEBUG ( 1280): bea153a0 df002777<br>
I/DEBUG ( 1280): bea153a4 e3a070ad<br>
I/DEBUG ( 1280): #00 bea153a8 809a2400 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea153ac 00240d00 [heap]<br>
I/DEBUG ( 1280): bea153b0 00000000<br>
I/DEBUG ( 1280): bea153b4 0000cd28 [heap]<br>
I/DEBUG ( 1280): bea153b8 80917040 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea153bc 809681f7 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): #01 bea153c0 4867acc0 /dev/ashmem/mspace/dalvik-heap/2 (deleted)<br>
I/DEBUG ( 1280): bea153c4 400092d0 /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)<br>
I/DEBUG ( 1280): bea153c8 00000000<br>
I/DEBUG ( 1280): bea153cc 4867acc0 /dev/ashmem/mspace/dalvik-heap/2 (deleted)<br>
I/DEBUG ( 1280): bea153d0 4831de40 /dev/ashmem/mspace/dalvik-heap/2 (deleted)<br>
I/DEBUG ( 1280): bea153d4 00240ce8 [heap]<br>
I/DEBUG ( 1280): bea153d8 00000000<br>
I/DEBUG ( 1280): bea153dc ade46221 /system/lib/libicuuc.so<br>
I/DEBUG ( 1280): bea153e0 00000001<br>
I/DEBUG ( 1280): bea153e4 00240ce8 [heap]<br>
I/DEBUG ( 1280): bea153e8 4831de40 /dev/ashmem/mspace/dalvik-heap/2 (deleted)<br>
I/DEBUG ( 1280): bea153ec 809a2400 /system/lib/libdvm.so<br>
I/DEBUG ( 1280): bea153f0 00240cd0 [heap]<br>
I/DEBUG ( 1280): bea153f4 8096823d /system/lib/libdvm.so<br>
<br>
<br>
-abhay<br>
<br>
________________________________<br>
From: Abhay B. Chaware<br>
Sent: Monday, June 13, 2011 9:43 AM<br>
To: &#39;Rules Users List&#39;<br>
Subject: FW: [rules-users] Drools in non-eclipse environment<br>
<br>
Any ideas folks ?<br>
________________________________<br>
From: Abhay B. Chaware<br>
Sent: Friday, June 10, 2011 12:54 PM<br>
To: &#39;Rules Users List&#39;<br>
Subject: RE: [rules-users] Drools in non-eclipse environment<br>
<br>
The ride’s real fun ☺<br>
<br>
Got apache harmony’s beans.jar to work .. now , when I am reading the serialized knowledgebase object on android, quite obvious, it is throwing this error –<br>
<br>
java.lang.UnsupportedOperationException: can&#39;t load this type of class file<br>
<br>
since my serialized knowledgebase object is in java format .. and not dex. Can this serialized version be converted into .dex format using the “dx” utility – pre or post serialization ? I tried the “dx” tool on the serialized object, but it doesn’t seem to understand the format.<br>

<br>
-abhay<br>
<br>
________________________________<br>
</div></div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt; [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;] On Behalf Of Michael Anstis<br>

<div class="im">Sent: Thursday, June 09, 2011 6:37 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
<br>
<a href="http://meteatamel.wordpress.com/2010/08/25/android-api-and-java-beans-package/" target="_blank">http://meteatamel.wordpress.com/2010/08/25/android-api-and-java-beans-package/</a><br>
<br>
<a href="http://meteatamel.wordpress.com/2010/09/28/android-api-and-java-beans-package-2/" target="_blank">http://meteatamel.wordpress.com/2010/09/28/android-api-and-java-beans-package-2/</a><br>
<br>
Enjoy the ride ;)<br>
</div>2011/6/9 Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt;<br>
woo hooo ! I got past that problem ☺  But a new one’s here now.<br>
<br>
Looks like MVEL is not liking something ☺<br>
<div><div></div><div class="h5"><br>
<br>
<br>
W/dalvikvm(29977): VFY: unable to resolve static method 164: Ljava/beans/Introspector;.decapitalize (Ljava/lang/String;)Ljava/lang<br>
/String;<br>
W/dalvikvm(29977): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)<br>
E/AndroidRuntime(29977): FATAL EXCEPTION: main<br>
E/AndroidRuntime(29977): java.lang.NoClassDefFoundError: java.beans.Introspector<br>
E/AndroidRuntime(29977):        at org.drools.core.util.asm.ClassFieldInspector.calcFieldName(ClassFieldInspector.java:298)<br>
E/AndroidRuntime(29977):        at org.drools.core.util.asm.ClassFieldInspector.addToMapping(ClassFieldInspector.java:216)<br>
E/AndroidRuntime(29977):        at org.drools.core.util.asm.ClassFieldInspector.processClassWithoutByteCode(ClassFieldInspector.ja<br>
va:148)<br>
E/AndroidRuntime(29977):        at org.drools.core.util.asm.ClassFieldInspector.&lt;init&gt;(ClassFieldInspector.java:83)<br>
E/AndroidRuntime(29977):        at org.drools.core.util.asm.ClassFieldInspector.&lt;init&gt;(ClassFieldInspector.java:64)<br>
E/AndroidRuntime(29977):        at org.drools.base.ClassFieldAccessorFactory.getClassFieldReader(ClassFieldAccessorFactory.java:11<br>
8)<br>
E/AndroidRuntime(29977):        at org.drools.base.ClassFieldAccessorCache$CacheEntry.getReadAccessor(ClassFieldAccessorCache.java<br>
:168)<br>
E/AndroidRuntime(29977):        at org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:101)<br>
E/AndroidRuntime(29977):        at org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:404)<br>
E/AndroidRuntime(29977):        at org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:374)<br>
E/AndroidRuntime(29977):        at org.drools.common.AbstractRuleBase.readExternal(AbstractRuleBase.java:295)<br>
E/AndroidRuntime(29977):        at org.drools.reteoo.ReteooRuleBase.readExternal(ReteooRuleBase.java:236)<br>
E/AndroidRuntime(29977):        at org.drools.impl.KnowledgeBaseImpl.readExternal(KnowledgeBaseImpl.java:108)<br>
E/AndroidRuntime(29977):        at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2127)<br>
E/AndroidRuntime(29977):        at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:929)<br>
E/AndroidRuntime(29977):        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2285)<br>
E/AndroidRuntime(29977):        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2240)<br>
E/AndroidRuntime(29977):        at com.ts.DBconnector.execPackageByPath(DBconnector.java:219)<br>
E/AndroidRuntime(29977):        at com.first.FirstActivity.onCreate(FirstActivity.java:77)<br>
E/AndroidRuntime(29977):        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)<br>
E/AndroidRuntime(29977):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)<br>
E/AndroidRuntime(29977):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)<br>
E/AndroidRuntime(29977):        at android.app.ActivityThread.access$2300(ActivityThread.java:125)<br>
E/AndroidRuntime(29977):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)<br>
E/AndroidRuntime(29977):        at android.os.Handler.dispatchMessage(Handler.java:99)<br>
E/AndroidRuntime(29977):        at android.os.Looper.loop(Looper.java:123)<br>
E/AndroidRuntime(29977):        at android.app.ActivityThread.main(ActivityThread.java:4627)<br>
E/AndroidRuntime(29977):        at java.lang.reflect.Method.invokeNative(Native Method)<br>
E/AndroidRuntime(29977):        at java.lang.reflect.Method.invoke(Method.java:521)<br>
E/AndroidRuntime(29977):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)<br>
E/AndroidRuntime(29977):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)<br>
E/AndroidRuntime(29977):        at dalvik.system.NativeStart.main(Native Method)<br>
<br>
<br>
<br>
________________________________<br>
</div></div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt; [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;] On Behalf Of Michael Anstis<br>

<div class="im">Sent: Thursday, June 09, 2011 4:51 PM<br>
<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
<br>
Great news :)<br>
<br>
Please do feedback... if you get it working I&#39;ll make a blog entry on your behalf as you are not the first (or last) to try Drools on Android.<br>
<br>
With kind regards,<br>
<br>
Mike<br>
</div>2011/6/9 Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt;<br>
<div class="im">That’s exactly what I am trying out at the moment .. option – b.  Pre-compile, serialize and unserialize …I’ll share the results.<br>
Also rule file’s there at the location mentioned. So that’s not a problem.<br>
I’ve gone through the blog you mentioned … and as you indicated, it’s only jbpm .. no rules …<br>
<br>
thanks<br>
abhay<br>
________________________________<br>
</div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt; [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;] On Behalf Of Michael Anstis<br>

<div class="im">Sent: Thursday, June 09, 2011 4:07 PM<br>
<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
<br>
Preparing to be shouted down, but isn&#39;t it impossible to compile DRL on Android and the suggestion is to load pre-serialised KnowledgeBases?<br>
<br>
Also, as another observation, are you sure the DRL was indeed found and the NPE is not caused by &quot;com.ts.DBconnector.readKnowledgeBase(DBconnector.java:143)&quot; perhaps passing a null to KnowledgeBuilder?<br>
<br>
Have you looked at <a href="http://blog.athico.com/2011/03/jbpm5-lightweight-running-on-android.html" target="_blank">http://blog.athico.com/2011/03/jbpm5-lightweight-running-on-android.html</a>, which might give some pointers - although it is only jBPM and not rules themselves.<br>

<br>
With kind regards,<br>
<br>
Mike<br>
</div><div class="im">On 9 June 2011 11:11, Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt; wrote:<br>

This is what I did.<br>
<br>
               Properties properties = new Properties();<br>
               properties.put(&quot;drools.dialect.java.compiler&quot;, &quot;JANINO&quot;);<br>
               KnowledgeBuilderConfiguration kbConfig = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration( properties, (ClassLoader[]) null );<br>
               KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbConfig);<br>
               kbuilder.add(ResourceFactory.newInputStreamResource(is), ResourceType.DRL);<br>
I am getting same error with KnowledgeBuilderConfiguration ..<br>
<br>
W/System.err(27303): java.lang.NullPointerException<br>
W/System.err(27303):    at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)<br>
W/System.err(27303):    at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1161)<br>
W/System.err(27303):    at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:637)<br>
W/System.err(27303):    at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:267)<br>
W/System.err(27303):    at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:459)<br>
W/System.err(27303):    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)<br>
W/System.err(27303):    at com.ts.DBconnector.readKnowledgeBase(DBconnector.java:143)<br>
W/System.err(27303):    at com.first.FirstActivity.onCreate(FirstActivity.java:64)<br>
W/System.err(27303):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)<br>
W/System.err(27303):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)<br>
W/System.err(27303):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)<br>
W/System.err(27303):    at android.app.ActivityThread.access$2300(ActivityThread.java:125)<br>
<br>
<br>
________________________________________<br>
</div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt; [<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;] On Behalf Of Wolfgang Laun [<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&lt;mailto:<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;]<br>

<div class="im">Sent: Thursday, June 09, 2011 2:46 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
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>
</div><div class="im">On 9 June 2011 10:29, Abhay B. Chaware &lt;<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&lt;mailto:<a href="mailto:Abhay.Chaware@kpitcummins.com">Abhay.Chaware@kpitcummins.com</a>&gt;&gt;&gt; wrote:<br>

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>
</div>From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&gt; [<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&gt;] On Behalf Of Swindells, Thomas [<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&lt;mailto:<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;&lt;mailto:<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&lt;mailto:<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;&gt;]<br>

<div class="im">Sent: Thursday, June 09, 2011 1:40 PM<br>
To: Rules Users List<br>
Subject: Re: [rules-users] Drools in non-eclipse environment<br>
<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>
</div>&gt; From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>&gt;&gt; [mailto:<a href="mailto:rules-users-">rules-users-</a>&lt;mailto:<a href="mailto:rules-users-">rules-users-</a>&gt;&lt;mailto:<a href="mailto:rules-users-">rules-users-</a>&lt;mailto:<a href="mailto:rules-users-">rules-users-</a>&gt;&gt;<br>

&gt; <a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>&lt;mailto:<a href="mailto:bounces@lists.jboss.org">bounces@lists.jboss.org</a>&gt;&gt;] On Behalf Of Abhay B. Chaware<br>

<div class="im">&gt; Sent: 09 June 2011 08:06<br>
</div>&gt; To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&gt;<br>

<div><div></div><div class="h5">&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>
</div></div>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&gt;<br>

<div class="im">&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>
</div>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>&lt;mailto:<a href="mailto:postmaster@nds.com">postmaster@nds.com</a>&gt;&lt;mailto:<a href="mailto:postmaster@nds.com">postmaster@nds.com</a>&lt;mailto:<a href="mailto:postmaster@nds.com">postmaster@nds.com</a>&gt;&gt; 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>

<div class="im"><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>
</div><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&gt;<br>

<div class="im"><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>
</div><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;&gt;<br>

<div class="im"><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>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<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>
</div><div class="im">This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.<br>

<br>
_______________________________________________<br>
rules-users mailing list<br>
</div><div class="im"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<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>
</div><div class="im">This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.<br>

<br>
_______________________________________________<br>
rules-users mailing list<br>
</div><div class="im"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<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>
</div><div class="im">This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.<br>

<br>
_______________________________________________<br>
rules-users mailing list<br>
</div><div class="im"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<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>
</div><div><div></div><div class="h5">This message contains information that may be privileged or confidential and is the property of the KPIT Cummins Infosystems Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins Infosystems Ltd. does not accept any liability for virus infected mails.<br>

<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&lt;mailto:<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<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>
<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>