5.3.0 NoClassDefFound due to nested property access
by Wolfgang Laun
Is this already known and fixed in 5.4.0? The problem occurs when you
have, e.g.,
Fact( foo.bar == "baz" )
Stack dump:
Exception in thread "main" java.lang.NoClassDefFoundError: monitor/Monitor
at ASMAccessorImpl_114212541328697624590.getValue(Unknown Source)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:106)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.MVEL.executeExpression(MVEL.java:954)
at org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:100)
at org.drools.base.extractors.BaseObjectClassFieldReader.isNullValue(BaseObjectClassFieldReader.java:179)
at org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromFactHandle(VariableRestriction.java:338)
at org.drools.common.SingleBetaConstraints.updateFromFactHandle(SingleBetaConstraints.java:118)
at org.drools.reteoo.NotNode.modifyRightTuple(NotNode.java:339)
at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:431)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:468)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:436)
at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:288)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:271)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:459)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:363)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:298)
at monitor.Rule_stop_monitoring.defaultConsequence(Rule_stop_monitoring.java:8)
at monitor.Rule_stop_monitoringDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
at org.drools.common.Scheduler$ActivationTimerJob.execute(Scheduler.java:90)
at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:46)
at org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:13)
at org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:203)
at org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:156)
14 years, 1 month
Multiple threading
by Apache
Hey,
I am trying to get multiple threads to insert events and run rules against the union of events inserted ( an as soon as they are inserted, a timer drools thread kicking of fireallrules() is not an option because that would introduce a delay ) and wanted some opinion on the following:
1. Stateless session is basically a wrapper around statefulsession and since per doc statefulsession is not threadsafe is it safe to assume 2 threads cannot insert and run fireallrules to compare against a union of objects inserted by multiple threads without some synchronication on event insertion and ESP fireallrulesrules ? ( would the answer still hold despite a drools-camel endpoint reading and storing exchanges from multiple threads ? )
2. If in the above point we simplify the case where the rule uses the "from" keyword and reads from a cache or a Db ( is reading from
A cache supported out of the box ? ) then will drools bhaviour will be bound by the thread which invokes fireallrules() ?
14 years, 1 month
MVEL strict-mode vs. performance
by womuji
Hi,
We are upgrading from Drools 5.1 to 5.3 to improve the performance, but we
are hoping to keep our drl files intact. We were trying to use the old drl
files by setting "drools.dialect.mvel.strict=false", but somehow with this
setting we still got " unable to resolve method using strict-mode .." error
from time to time.
I'm wondering if there is any correlation between this strict-mode and the
performance gain, if in order to achieve the performance gain, we have to
set the strict-mode to true, then we will make changes to our drl files,
instead of spending time to figure out why the effect of
"drools.dialect.mvel.strict=false" is sporadic.
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-strict-mode-vs-performance-tp37418...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Re: [rules-users] rules-users Digest, Vol 63, Issue 60
by Shur, Bob
I don't understand either of these answers. All of the facts are in a list of facts passed into ksession.execute, like this:
final StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
List<Object> facts = createPosts();
if (facts.size() == 0) break;
long t0 = System.currentTimeMillis()/100;
ksession.execute(facts);
long t1 = System.currentTimeMillis()/100;
System.out.println("Elapsed time: " + (t1 - t0));
There are no more facts getting created during rules processing. The whole drl file is:
rule "collect"
when
$a : ArrayList(size > 0) from collect(Post());
then
System.out.println("Number of posts: " + $a.size());
System.out.println("DONE");
end
Why is the collect happening more than once? Actually I don't think it is, else I would be seeing more than one printout.
I agree that I could probably find a way to do without the list, but I would still like to understand why this is n-squared. I was actually planning to explore the performance of various ways to compute the minimum of a large number of objects. I was surprised to find that I was already up to n-squared just creating the list.
> ------------------------------
>
> Message: 3
> Date: Mon, 13 Feb 2012 20:59:20 +0100
> From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
> Subject: Re: [rules-users] Performance of collect seems to be
> n-squared
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID:
> <CANaj1LeAnD-
> kYngQqTzo1XoOh4V8tnqo5A+9CkVR6xPmK4gxMA(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Repeatedly creating this ArrayList is bound to be O(n2).
>
> Why do you want the Post facts as a List? There may be better ways for
> achieving your goal.
>
> -W
>
>
> On 13 February 2012 20:49, Shur, Bob <robert.shur(a)hp.com> wrote:
>
> > I have a simple class Post { int id; ... }. I insert some number of
> them
> > as facts and then call ksession.execute(facts);
> >
> > The whole drl file (except for package and import statements) is:
> >
> > rule "collect"
> > when
> > $a : ArrayList(size > 0) from collect(Post());
> > then
> > System.out.println("Number of posts: " + $a.size());
> > System.out.println("DONE");
> > end
> >
> > The time it takes to run is n-squared in the number of posts. For
> 4000,
> > 8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):
> >
> > 4, 14, 56, 220, 852
> >
> > Is this expected? Is there a better way for me to do the collect?
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
14 years, 1 month
Performance of collect seems to be n-squared
by Shur, Bob
I have a simple class Post { int id; ... }. I insert some number of them as facts and then call ksession.execute(facts);
The whole drl file (except for package and import statements) is:
rule "collect"
when
$a : ArrayList(size > 0) from collect(Post());
then
System.out.println("Number of posts: " + $a.size());
System.out.println("DONE");
end
The time it takes to run is n-squared in the number of posts. For 4000, 8000, 16000, 32000, 64000 posts the time is (in 1/10 seconds):
4, 14, 56, 220, 852
Is this expected? Is there a better way for me to do the collect?
14 years, 1 month
Re: [rules-users] Error running Drools 5.0 HelloWorldExample on WebSphere 6.1
by Blythe, Marshall
A quick follow-up: this error occurs only when I have rules using the MVEL dialect. I rewrote the MVEL rule in the HelloWorld.drl to use the Java dialect, and now the problem is gone. I may need to raise this issue on the MVEL mailing list instead.
----------------------------------------- This e-mail and any attachments may contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If you are not the intended recipient, any use or disclosure of this information is STRICTLY PROHIBITED; you are requested to delete this e-mail and any attachments, notify the sender immediately, and notify the LabCorp Privacy Officer at privacyofficer(a)labcorp.com or call (877) 23-HIPAA.
14 years, 1 month
Performance scaling with fact insertion
by St. Lawrence, Zachary
I was running some performance analysis on my rules so I could tune in hopes of scaling up from hundreds of thousands of datapoints to millions of entries and noticed some alarming performance scaling issues when rules are firing and inserting dependent objects. At first I thought it was one of my more complex rules but when I broke down my examples to the simplest possible test cases I found that the central problem was that performance was not linear with number of facts inserted -- it was polynominal (roughly n^2.5).
My simplest test example was basically each fact inserted initially would trigger a new logical relationship fact to be inserted. No fancy logic. Also it could not trigger itself recursively. I tried three approaches : logical inserts of new facts, manual inserts/retraction, and update of the current fact with new data.
Updates on current fact were roughly linear assuming I prevented re-firing.
Manual Inserts and retracts scaled with O(n^2.5)
LogicalInserts were O(n^3)
The documentation suggest insertion of dependent facts to simplify logic. But when dealing with tens of thousands of events triggering it did not scale sufficiently. Can anyone tell me what I may have done wrong? I have included rules and data below.
This was on 5.3 using fireAllRules. The time measured was rule execution only and excluded times due to my testing framework.
// SIMPLIFIED RULES FILE
declare DataPoint
anomaly : boolean
entityId : String
average : double
predict : double
predictDev : double
timestamp : long
end
declare AnomalyFact
entityId : String
anomalyType : AnomalyType
ruleName : String
timestamp : long
end
rule "Traffic Below 4 Deviations"
no-loop
when
$datapoint : DataPoint (
anomaly==false,
average < (predict - (predictDev * 4))
)
then
// update self only. This line was always active.
modify($datapoint) {setAnomaly(true)};
// on logicalInsert test I commented in the following line
// insertLogical( new AnomalyFact ( $datapoint.getEntityId(), AnomalyEnum.LOW, drools.getRule().getName(), $datapoint.getTimestamp()));
// on insert test I commented in the following line and added another rule to retract any anomaly with no datapoint
// insert( new AnomalyFact ( $datapoint.getEntityId(), AnomalyEnum.LOW, drools.getRule().getName(), $datapoint.getTimestamp()));
end
/* TEST RESULT CONTAINED BELOW
All data inserted triggered the rule. I was load testing for worst case behavior.
logicalInsert
n run1 run2 run3
5000 1293 1232 1767
10000 9458 8210 10079
15000 24389 31050 24311
30000 134936
manual insert/retract
n run1 run2 run3
5000 1137 1094 1169
10000 8090 5862 5616
15000 16741 16728 15874
30000 76034
update on current object only
n run1 run2 run3
5000 417 444 413
10000 600
15000 712 697 688
30000 999 970 1041 1016 1163
60000 1420
100000 1930
Thanks for any help!
*/
14 years, 1 month