[JBoss JIRA] (DROOLS-1610) Runtime Exception
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1610?page=com.atlassian.jira.plugi... ]
Mario Fusco commented on DROOLS-1610:
-------------------------------------
I cannot recreate your problem. Please provide a reproducer of this issue. Also before doing this give a try to 7.0.0.Final.
> Runtime Exception
> ------------------
>
> Key: DROOLS-1610
> URL: https://issues.jboss.org/browse/DROOLS-1610
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.5.0.Final
> Reporter: Salman Khan
> Assignee: Mario Fusco
>
> Getting the following exception while trying to implement Drools in Android.
> 06-08 12:25:41.660 19177-19177/com.example.admin23.droolstest W/System.err: java.lang.RuntimeException: Unable to instantiate object for class 'org.drools.android.DexPackageClassLoader' with constructor public org.drools.android.DexPackageClassLoader(org.drools.core.rule.JavaDialectRuntimeData,java.lang.ClassLoader)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.core.util.ClassUtils.instantiateObject(ClassUtils.java:272)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.core.rule.JavaDialectRuntimeData.makeClassLoader(JavaDialectRuntimeData.java:618)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.core.rule.JavaDialectRuntimeData.onAdd(JavaDialectRuntimeData.java:243)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.rule.builder.dialect.java.JavaDialect.<init>(JavaDialect.java:187)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.rule.builder.dialect.java.JavaDialectConfiguration.newDialect(JavaDialectConfiguration.java:91)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.buildDialectRegistry(KnowledgeBuilderConfigurationImpl.java:392)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.compiler.PackageRegistry.<init>(PackageRegistry.java:55)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.newPackage(KnowledgeBuilderImpl.java:1571)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.initPackageRegistry(KnowledgeBuilderImpl.java:1044)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.createPackageRegistry(KnowledgeBuilderImpl.java:1015)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.initPackageRegistries(CompositeKnowledgeBuilderImpl.java:297)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:116)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:105)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:244)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:64)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:230)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:198)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at com.example.admin23.droolstest.MainActivity.onCreate(MainActivity.java:143)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.Activity.performCreate(Activity.java:6876)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.ActivityThread.access$1100(ActivityThread.java:221)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.os.Handler.dispatchMessage(Handler.java:102)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.os.Looper.loop(Looper.java:158)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7224)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at java.lang.reflect.Method.invoke(Native Method)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: Caused by: java.lang.reflect.InvocationTargetException
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at java.lang.reflect.Constructor.newInstance(Native Method)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.core.util.ClassUtils.instantiateObject(ClassUtils.java:270)
> 06-08 12:25:41.670 19177-19177/com.example.admin23.droolstest W/System.err: ... 29 more
> 06-08 12:25:41.680 19177-19177/com.example.admin23.droolstest W/System.err: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getAbsolutePath()' on a null object reference
> 06-08 12:25:41.680 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.android.MultiDexClassLoader.<init>(MultiDexClassLoader.java:70)
> 06-08 12:25:41.680 19177-19177/com.example.admin23.droolstest W/System.err: at org.drools.android.DexPackageClassLoader.<init>(DexPackageClassLoader.java:44)
> 06-08 12:25:41.680 19177-19177/com.example.admin23.droolstest W/System.err: ... 31 more
> Whenever I'm trying to call kieBuilder.buildAll(); method it's giving me the exception rather giving the result array. Please help to resolve this. Any help would be appreciable.
> Thanks in advance.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (DROOLS-1624) Map Handling with Property Reactive Always Enabled
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1624?page=com.atlassian.jira.plugi... ]
Mario Fusco resolved DROOLS-1624.
---------------------------------
Resolution: Rejected
The root cause of this issue is not in the fact that your data are backed by a Map but in the fact that you're using those isPresent() and notPresent() methods inside your rules. Drools cannot have any clue of what those methods do internally and then property reactivity cannot work. Note that you can also disable property reactivity on a single class by annotating it with @ClassReactive
> Map Handling with Property Reactive Always Enabled
> --------------------------------------------------
>
> Key: DROOLS-1624
> URL: https://issues.jboss.org/browse/DROOLS-1624
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.0.0.Final
> Environment: * JDK8
> * Docker running Alpine
> Reporter: KimJohn Quinn
> Assignee: Mario Fusco
> Priority: Minor
> Attachments: drools.zip
>
>
> Referencing a conversation on [Google Groups - Drools Usage|https://groups.google.com/forum/?fromgroups#!topic/drools-usage/G7r...] and as requested by Mario Fusco...
> We currently have a ruleset that relies heavily on Map facts. In Drools 6.5 we fire approximately 400 rules.
> In Drools 7.0 we get only about 50 rules unless we add the "<property key="drools.propertySpecific" value="ALLOWED"/>" to the kmodule.xml, in which case we fire the full 400 rules or by using @Watch(*) or @Watch(!*) on the rules. It "seems" like only the first evaluations of the rules are firing and then no others after that.
> Our flow generally follows something like below, within a stateful session, using rules only. We fire all rules per-request then close the session.
> Watch for changes to the Map properties
> If a certain property or properties exist a 'populate' rule fires (calls modify())
> The populate rule enriches the map fact. (calls modify())
> Based on #3, more rules fire when certain properties exist (calls modify())
> We are work heavily with rules that depend on loaded available facts up-front and computed properties throughout evaluation.
> I have a couple of usage questions regarding Drools 7, the default enabling of Property Reactive and using Maps as the facts:
> In general, how do maps work with property reactive and respond to modify/insert events? Does Drools look at the Map as a whole, any change re-evaluates the tree, or each individual property within the map re-evaluates the change?
> In Drools 7, by defaulting the property reactive setting, does that mean all rules need to be annotated or they should they work as is (dao or map-based facts) when using modify/insert?
> For reference, we are relying on this doco https://docs.jboss.org/drools/release/7.0.0.Final/drools-docs/html_single....
> I am looking into details or an example how to properly use Maps in Drools 7 with Property Reactive features always enabled (as suggested per the doco)....
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (DROOLS-1631) newKieSession("rules") takes 2 minutes in 6.2.0.Final - takes 20 minutes in 6.5.0.Final and 7.0.0.Final
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1631?page=com.atlassian.jira.plugi... ]
Mario Fusco closed DROOLS-1631.
-------------------------------
Resolution: Duplicate
The compile time performance degradation you reported has been very likely caused by the issue reported here https://issues.jboss.org/browse/DROOLS-1581 that has been already fixed on master. As a side note and regardless of this issue I strongly suggest to avoid using evals in your rules: they're useless in 99.9% of cases, worsen readability of rules and may also negatively impact runtime performances.
> newKieSession("rules") takes 2 minutes in 6.2.0.Final - takes 20 minutes in 6.5.0.Final and 7.0.0.Final
> -------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-1631
> URL: https://issues.jboss.org/browse/DROOLS-1631
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.5.0.Final, 7.0.0.Final
> Reporter: Mark Langford
> Assignee: Mario Fusco
>
> We are currently converting our iLog rule engine solution to a Drools based system with good success. The project is a Maven project using Spring Boot 1.5.2 and Java 1.8. We have converted 1800+ rules (including 83 decision tables) from their iLog format to Drools format. We were using version 6.2.0. The newKieSession method took approx 2 minutes on the first run to compile our rules and provide the kieSession: -
> KieContainer kieContainer = KieServices.Factory.get().newKieClasspathContainer();
> KieSession kSession = kieContainer.newKieSession("ric-rules");
> I decided to upgrade to version 6.5.0 by updating our pom.xml.
> When I ran the code again, the above newKieSession method took 20 minutes to complete. It also seems like our rule processing stalled or hung with no Exceptions being reported.
> I have the following dependencies in our pom.xml
> <drools.version>6.5.0.Final</drools.version>
> <dependencies>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-web</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-jdbc</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-data-jpa</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-mail</artifactId>
> </dependency>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-actuator</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-test</artifactId>
> <scope>test</scope>
> </dependency>
>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-jms</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.kie</groupId>
> <artifactId>kie-api</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-core</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-compiler</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-decisiontables</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-templates</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.commons</groupId>
> <artifactId>commons-lang3</artifactId>
> <version>3.6</version>
> </dependency>
> I also found someone else on Stackoverflow with the same/similar issue
> [https://stackoverflow.com/questions/44406051/drools-6-5-0-drl-compile-tim...]
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (DROOLS-1631) newKieSession("rules") takes 2 minutes in 6.2.0.Final - takes 20 minutes in 6.5.0.Final and 7.0.0.Final
by Mario Fusco (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1631?page=com.atlassian.jira.plugi... ]
Mario Fusco updated DROOLS-1631:
--------------------------------
Sprint: 2017 Week 24-25
> newKieSession("rules") takes 2 minutes in 6.2.0.Final - takes 20 minutes in 6.5.0.Final and 7.0.0.Final
> -------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-1631
> URL: https://issues.jboss.org/browse/DROOLS-1631
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 6.5.0.Final, 7.0.0.Final
> Reporter: Mark Langford
> Assignee: Mario Fusco
>
> We are currently converting our iLog rule engine solution to a Drools based system with good success. The project is a Maven project using Spring Boot 1.5.2 and Java 1.8. We have converted 1800+ rules (including 83 decision tables) from their iLog format to Drools format. We were using version 6.2.0. The newKieSession method took approx 2 minutes on the first run to compile our rules and provide the kieSession: -
> KieContainer kieContainer = KieServices.Factory.get().newKieClasspathContainer();
> KieSession kSession = kieContainer.newKieSession("ric-rules");
> I decided to upgrade to version 6.5.0 by updating our pom.xml.
> When I ran the code again, the above newKieSession method took 20 minutes to complete. It also seems like our rule processing stalled or hung with no Exceptions being reported.
> I have the following dependencies in our pom.xml
> <drools.version>6.5.0.Final</drools.version>
> <dependencies>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-web</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-jdbc</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-data-jpa</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-mail</artifactId>
> </dependency>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-actuator</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.springframework.boot</groupId>
> <artifactId>spring-boot-starter-test</artifactId>
> <scope>test</scope>
> </dependency>
>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-jms</artifactId>
> </dependency>
>
> <dependency>
> <groupId>org.kie</groupId>
> <artifactId>kie-api</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-core</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-compiler</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-decisiontables</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.drools</groupId>
> <artifactId>drools-templates</artifactId>
> <version>${drools.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.commons</groupId>
> <artifactId>commons-lang3</artifactId>
> <version>3.6</version>
> </dependency>
> I also found someone else on Stackoverflow with the same/similar issue
> [https://stackoverflow.com/questions/44406051/drools-6-5-0-drl-compile-tim...]
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months