[JBoss JIRA] (DROOLS-3277) KieScanner in Scala fat-jar application does not work due to Plexus configuration
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-3277?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-3277.
---------------------------------
Resolution: Explained
See https://docs.jboss.org/drools/release/7.25.0.Final/drools-docs/html_singl...
> KieScanner in Scala fat-jar application does not work due to Plexus configuration
> ---------------------------------------------------------------------------------
>
> Key: DROOLS-3277
> URL: https://issues.redhat.com/browse/DROOLS-3277
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.13.0.Final
> Reporter: Michael Reynolds
> Assignee: Mario Fusco
> Priority: Major
> Attachments: components.xml, out.log
>
>
> The configuration required for all the KIE related components wired together with Sisu and in Plexus is spread out among many files with the same name/location in various library jars.
> The SBT assembly plugin is the standard for building a Scala fat-jar application. When it multiple versions of the same file when squashing the jars together it attempts to apply a merge strategy to them. For the Sisu configuration, it is simple enough to apply a "concat" merge strategy. However, the META-INF/plexus/components.xml cannot be automatically merged. Unless all the elements are present, various component lookups will fail when using the KieScanner.
> I've provided the following attachments related to this case:
> ||File||Description||
> |out.log|Output of starting the fat-jar application without properly merging the Sisu and Plexus configuration files|
> |components.xml|The merged components.xml file I created that resolves this issue.|
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-3583) A comment creates an infinite loop
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-3583?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-3583:
--------------------------------
Sprint: 2019 Week 50-52 (from Dec 9)
> A comment creates an infinite loop
> ----------------------------------
>
> Key: DROOLS-3583
> URL: https://issues.redhat.com/browse/DROOLS-3583
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.16.0.Final
> Reporter: Osira Ben
> Assignee: Mario Fusco
> Priority: Minor
>
> This rule file makes the engine stuck in an infinite loop.
> {code:drools}
> package com.example
> declare Counter
> value: int
> end
> rule "Init" when
> not Counter()
> then
> drools.insert(new Counter(0));
> end
> rule "Loop"
> when
> c: Counter()
> then
> // removing this comment line removes the loop
> c.setValue(1);
> update(c);
> end
> {code}
> But the loop is not an issue.
> The issue is that if the commented line is removed the loop is gone.
> This code doesn't cause the loop.
> {code:drools}
> package com.example
> declare Counter
> value: int
> end
> rule "Init" when
> not Counter()
> then
> drools.insert(new Counter(0));
> end
> rule "Loop"
> when
> c: Counter()
> then
> c.setValue(1);
> update(c);
> end
> {code}
> Java code used to run the engine.
> {code:java}
> public class DroolsLoopingTest {
> public static class LoopError extends RuntimeException {
> }
> public static void main(String[] args) {
> System.setProperty("drools.dump.dir", ".");
> final KieServices ks = KieServices.Factory.get();
> final KieRepository kr = ks.getRepository();
> final KieFileSystem kfs = ks.newKieFileSystem();
> kfs.write("src/main/resources/loop.drl", new ClassPathResource("loop.drl"));
> final KieBuilder kb = ks.newKieBuilder(kfs);
> kb.buildAll();
> if (kb.getResults().hasMessages(Message.Level.ERROR))
> throw new RuntimeException(kb.getResults().toString());
> final KieContainer kContainer = ks.newKieContainer(kr.getDefaultReleaseId());
> KieSession kSession = kContainer.newKieSession();
> kSession.addEventListener(new DefaultAgendaEventListener() {
> private int i = 0;
> @Override
> public void afterMatchFired(AfterMatchFiredEvent event) {
> System.out.println(event);
> if (++i > 10) throw new LoopError();
> }
> });
> try {
> kSession.fireAllRules();
> throw new RuntimeException("Expected loop error");
> } catch (LoopError e) {
> System.out.println("Loop detected");
> }
> }
> }
> {code}
> I noticed a difference in generated code.
> The rule file with the comment line generates this code
> {code:java}
> public static void defaultConsequence(KnowledgeHelper drools, com.example.Counter c, org.kie.api.runtime.rule.FactHandle c__Handle__ ) throws java.lang.Exception { org.kie.api.runtime.rule.RuleContext kcontext = drools;
> // removing this comment line removes the loop
> c.setValue(1);
> { drools.update( c__Handle__, org.drools.core.util.bitmask.AllSetButLastBitMask.get(), com.example.Counter.class ); };
> }
> {code}
> While the rule file without the comment line generates this code
> {code:java}
> public static void defaultConsequence(KnowledgeHelper drools, com.example.Counter c, org.kie.api.runtime.rule.FactHandle c__Handle__ ) throws java.lang.Exception { org.kie.api.runtime.rule.RuleContext kcontext = drools;
> c.setValue(1);
> { drools.update( c__Handle__, new org.drools.core.util.bitmask.LongBitMask(2L), com.example.Counter.class ); };
> }
> {code}
> Expected result is that comments should not affect engine behavior.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-3611) PropertyReactive with custom operator going in recursion on modify
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-3611?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-3611.
---------------------------------
Resolution: Explained
If you call an external function that function could virtually modifying anything on the object, so it's impossible for us to determine which property has been modified and then enable property reactivity on that change.
> PropertyReactive with custom operator going in recursion on modify
> ------------------------------------------------------------------
>
> Key: DROOLS-3611
> URL: https://issues.redhat.com/browse/DROOLS-3611
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.17.0.Final
> Reporter: shivani chandna
> Assignee: Mario Fusco
> Priority: Major
>
> We have two rules each modifying separate properties but.
>
> As long as we are using PropertyReactive with builtin operators like contains, matches the updates are restricted. There is no infinite recursion.
> We have created a custom operator that checks the value in the when condition eg: when DClass( collectionSet matchesInSet "value")
> then modify $c( setDataPoint( "s" );
> This usage of custom operator is making rule execution go in infinite loop. Enabling drools trace we see: Fired rule Rule 1 Fired rule Rule 2 Fired rule Rule 1 Fired rule Rule 2..... infinitely.
> As PropertyReactive is working properly with collections (Contains works well - there is no recursion) this looks like some fix is required in rule engine.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-3707) exception thrown in drools 7.7.0 Final
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-3707?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-3707.
---------------------------------
Resolution: Cannot Reproduce
The information provided are not enough to reproduce and investigate this issue. Please provide a complete reproducer and when you'll do so feel free to reopen this ticket.
> exception thrown in drools 7.7.0 Final
> --------------------------------------
>
> Key: DROOLS-3707
> URL: https://issues.redhat.com/browse/DROOLS-3707
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.7.0.Final
> Reporter: Monika Gupta
> Assignee: Mario Fusco
> Priority: Blocker
>
> drools 7.70 Final throws below exception when KieModule is created with below configuration , with 6,00,000 fact objects:
> kieHelper.build(
> SequentialAgendaOption.DYNAMIC,
> SequentialOption.YES,
> MultithreadEvaluationOption.YES,
> MaxThreadsOption.get(20)));
> java.lang.NullPointerException: null
> at org.drools.core.phreak.PhreakFromNode.doLeftUpdates(PhreakFromNode.java:199) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.PhreakFromNode.doNode(PhreakFromNode.java:64) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:393) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:339) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.doRiaNode(RuleNetworkEvaluator.java:620) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:547) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:379) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:339) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:175) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:133) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:212) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:87) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1066) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1013) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1005) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1330) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1321) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
> at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1305) ~[drools-core-7.17.0.Final.jar!/:7.17.0.Final]
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-3734) Executable model: Imports not evaluated correctly for fact declarations
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-3734?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-3734.
---------------------------------
Resolution: Cannot Reproduce
We cannot reproduce this problem. Please feel free to provide a small sample project reproducing it and when you do so reopen this ticket.
> Executable model: Imports not evaluated correctly for fact declarations
> -----------------------------------------------------------------------
>
> Key: DROOLS-3734
> URL: https://issues.redhat.com/browse/DROOLS-3734
> Project: Drools
> Issue Type: Bug
> Affects Versions: 7.12.0.Final, 7.17.0.Final
> Reporter: Olli Johnson
> Assignee: Mario Fusco
> Priority: Major
>
> If using the executable model (building with -DgenerateModel=YES) compilation errors occur for types defined in Java being used in DRL of the same maven model.
> When attempting to import a Java class defined under the same pom.xml module as the current rules file 'CompilationProblemErrorResult: cannot find symbol' errors are observed. Even when the import is not needed (Java type defined in same package as DRL rules), if the type is used in a type declaration the 'cannot find symbol' error is still observed.
> Errors are of the form:
> {code}
> [ERROR] Unable to build KieBaseModel:all
> CompilationProblemErrorResult: cannot find symbol
> symbol: class MyFact
> location: package olijohns
> CompilationProblemErrorResult: cannot find symbol
> symbol: class MyFact
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months
[JBoss JIRA] (DROOLS-4146) Query not scaling well
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-4146?page=com.atlassian.jira.plug... ]
Mario Fusco resolved DROOLS-4146.
---------------------------------
Resolution: Done
Can you please provide a project reproducing this issue so I could profile it?
> Query not scaling well
> ----------------------
>
> Key: DROOLS-4146
> URL: https://issues.redhat.com/browse/DROOLS-4146
> Project: Drools
> Issue Type: Enhancement
> Components: core engine
> Affects Versions: 7.22.0.Final
> Reporter: Jordan Jordanovski
> Assignee: Mario Fusco
> Priority: Minor
>
> While measuring for bottlenecks in my application I noticed that a considerable amount of time was spent on executing a really simple query. Then after focusing a little bit more on the queries I realized that they are not scaling well.
> Btw the Drools version that I'm using is 7.0.0-SNAPSHOT but by doing the same tests on the newest version (which at this point is 7.22.0.Final) the same problem is still present.
> *All the details can be found in this [StackOverflow question|https://stackoverflow.com/questions/56479961/drools-query-not-sc...
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 5 months