NullPointerException at org.mvel2.ast.IntSub.getReducedValueAccelerated
by Michiel Vermandel
Hi,
When starting the planning solver I sometimes get the error as listed beneath.
I think it happens about 1 out of 5 runs.
It doesn't seem to have much influence on the solving process as everything continues normally (I think).
I do not use any mvel expressions to my knowledge.
Anyway, it would be nice to understand why this happens and how to get this resolved.
Exception in thread "Thread-1" java.lang.NullPointerException
at org.mvel2.ast.IntSub.getReducedValueAccelerated(IntSub.java:17)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
at org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:44)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:108)
at org.mvel2.ast.And.getReducedValueAccelerated(And.java:34)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
at org.drools.rule.constraint.MvelConditionEvaluator.ensureBranchEvaluation(MvelConditionEvaluator.java:117)
at org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:102)
at org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:90)
at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:82)
at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:270)
at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Thanks,
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
12 years, 12 months
Test for element in an arraylist
by Bojan Janisch
Hello everyone,
I got a problem with my rule. To keep it
simple here's the code:
global java.util.ArrayList odmList
rule "Combine ODMAnswers"
when
$a1:ODMAnswer( )
$a2:ODMAnswer( )
eval(odmList contains $a1 && odmList contains $a2)
then
ODMAnswer answer = new ODMAnswer( );
odmList.add(answer);
odmList.remove($a1);
odmList.remove($a2);
end
So why do I get an error message looking like this:
Rule Compilation error Syntax error on token "contains", invalid AssignmentOperator
odmList.$a2 cannot be resolved or is not a field
Syntax error on token "contains", . expected
Thanks to everyone who reads this.
Bojan
12 years, 12 months
guvnor-ng branch will be renamed master
by Toni Rikkola
This is a warning for anyone working on guvnor-ng and master branches of the Guvnor repository.
I will rename the master to master-bk and guvnor-ng to master tomorrow.
Current master will not be used in any future releases. It will be stored for a while so we can be sure commits do not get lost.
I'll email this list when I am done. I advice to avoid any fetches or pushing tomorrow before my email.
Why not merge guvnor-ng to master? Sounds easy, but guvnor-ng has a lot of changes. Files changed names and locations, modules were split, code removed and the current master has nothing the new master will need.
Toni Rikkola
12 years, 12 months
How are rules imported into the knowledgebuilder?
by Bojan Janisch
Hello everybody,
the problem that I'm facing right know is,
that I want to create rules from a program
and (without writing it to file) loading it
into the knowledgebuilder.
So does anybody know how I can load a rule
into the knowledgebuilder without using a
file?
Thanks to everyone who reads this.
Bojan
12 years, 12 months
Can drool engine validate on xml input.
by sunil.ss
Hi, As of today we are using Drools 2.0, where we are converting the xml in
to java objects before validating by drools engine. Can we send xml directly
to Drools 5.2 or higher and validate directly instead of conversion from xml
to java. Also, please share if there are any design considerations while
migrating from drools 2.0 to 5.2 or higher. Which version is stable and all.
Regards, Sunil S
--
View this message in context: http://drools.46999.n3.nabble.com/Can-drool-engine-validate-on-xml-input-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 12 months
Rule performance with accumulate
by Ryan Crumley
Hi,
I am investigating performance of a Drools 5.4 stateful knowledge session.
This session has about 200 rules, 200k facts and takes about 1 hour to run
to completion. Looking at the profile there is a hotspot that consumes
almost 65% of the cpu time: java.util.AbstractList.hashCode().
Here is the full stack:
com.company.rules.engine.Rule_Set_weights_08b44ce519a74b58ab3f85735b2987cbDefaultConsequenceInvoker.evaluate(KnowledgeHelper,
WorkingMemory)
com.company.rules.engine.Rule_Set_weights_08b44ce519a74b58ab3f85735b2987cbDefaultConsequenceInvokerGenerated.evaluate(KnowledgeHelper,
WorkingMemory)
com.company.rules.engine.Rule_Set_weights_08b44ce519a74b58ab3f85735b2987cb.defaultConsequence(KnowledgeHelper,
List, FactHandle, GradingFact, FactHandle, ReportNode, FactHandle,
WeightsHolder, FactHandle, Logger)
org.drools.base.DefaultKnowledgeHelper.update(FactHandle, long)
org.drools.common.NamedEntryPoint.update(FactHandle, Object, long,
Activation)
org.drools.common.NamedEntryPoint.update(FactHandle, Object, long,
Activation)
org.drools.common.PropagationContextImpl.evaluateActionQueue(InternalWorkingMemory)
org.drools.reteoo.ReteooWorkingMemory$EvaluateResultConstraints.execute(InternalWorkingMemory)
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode$ActivitySource,
LeftTuple, PropagationContext, InternalWorkingMemory,
AccumulateNode$AccumulateMemory, AccumulateNode$AccumulateContext, boolean)
org.drools.common.DefaultFactHandle.setObject(Object)
java.util.AbstractList.hashCode()
I believe the following clues can be extracted:
- "Rule_Set_weights" was fired and a fact was modified (confirmed by
examining the rule definition)
- The fact modification caused the pre-conditions for other rules to be
computed.
- One of these rules has an accumulate condition that accumulates into an
AbstractList.
- This list is very very large. So large that looping through the elements
in the list and aggregating the hashCode of individual elements dominates
execution time (the individual element hashCode doesn't even show up in the
profile… either its very fast or maybe its identify hashCode which the
profiler might filter?).
- Accumulate is either working on a large set of data or the same
accumulate is evaluated many many times.
Is my analysis correct? Are there clues that I am missing?
I have 15 rules that use accumulate… However none accumulate with a result
of List. Most accumulate using sum() and count() (result of Number). A few
use collectSet(). A few more aggregate into a result with a custom type.
A few other notes:
- All accumulate conditions are the last condition in the WHEN clause.
- I use agenda groups to separate fact processing into phases. Rules that
accumulate are in a separate agenda group from rules that modify/insert
facts that are used in accumulation. I hope this prevents the accumulate
condition from being evaluated until all the rules that modify the facts
accumulate needs are done firing. I suspect this may not be working as I
expect. I haven't put together an example to investigate.
- When accumulating into a set, the rule condition looks like this:
$factName : Set() from accumulate( FactMatch( $field : field ),
collectionSet( $field ) )
How can I narrow down this further?
Are there any general rules to follow to optimize use of accumulate in
conditions?
Thanks,
Ryan
12 years, 12 months
guvnor - out of memory
by kurrent93
Hi
I recently starting using Streaming mode / CEP rules, and I'm not sure if
that is the reason, but I am getting guvnor dying due to out of memory.
Besides putting extra ram in the server, can anyone shed some light on this?
Any suggested solutions?
Thanks
03:44:44,152 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/guvnor].[PackageDeploymentServlet]]
(http--0.0.0.0-8080-2) Servlet.service() for servlet
PackageDeploymentServlet threw exception:
javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[rt.jar:1.7.0_09]
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[rt.jar:1.7.0_09]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[rt.jar:1.7.0_09]
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[rt.jar:1.7.0_09]
at java.lang.Class.newInstance0(Class.java:372) [rt.jar:1.7.0_09]
at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0_09]
at
org.jboss.weld.util.reflection.SecureReflections$16.work(SecureReflections.java:344)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInstantiation(SecureReflectionAccess.java:173)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.util.reflection.SecureReflections.newInstance(SecureReflections.java:341)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:33)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:73)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:162)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:241)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:229)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:207)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:573)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:563)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:558)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:74)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.13.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.13.Final.jar:]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
Caused by: javax.servlet.ServletException: Servlet execution threw an
exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:346)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
[weld-core-1.1.6.Final.jar:2012-03-21 18:52]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.13.Final.jar:]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:]
at
org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65)
[solder-impl-3.1.1.Final.jar:3.1.1.Final]
... 16 more
Caused by: java.lang.OutOfMemoryError: Java heap space
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-out-of-memory-tp4021555.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years
New object in XLS ACTION
by aleste
I'm trying to create a new object, populate a number of attributes in it and
insert it in memory as part of the ACTION in a decision table XLS.
I was able to do that in a single XLS column:
ACTION
insertLogical( new RuleError(t, Constants.ErrorType.PROMOTION, $1, $2));
Or using the guided decision tables in Guvnor:
FeeDTO [f3]
amount
10
20
(...)
But I have not been able to do it using an XLS and having multiple ACTION
columns. Something like:
ACTION ACTION
FeeDTO feeDTO = new FeeDTO();
feeDTO.setAmount(new BigDecimal($1)); feeDTO.setReason("$1");
This is the rule that I'd be expecting as result of the XLS compilation:
//from row number: 3
rule "Row 3 FeesTest"
dialect "mvel"
when
f1 : FinancialTransactionDTO( transactionType == TRANSACTION_TYPE.DEPOSIT
)
then
FeeDTO f3 = new FeeDTO();
f3.setAmount( 20 );
f3.setType( "Some Description" );
f3.setOverrideable (true);
insert( f3 );
end
--
View this message in context: http://drools.46999.n3.nabble.com/New-object-in-XLS-ACTION-tp4021374.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years