Hey everyone,
I have been running Drools 5.2 for a long time now and decided to try out
Drools 5.5 to see what was new. I felt that 5.2 was always a bit of a memory
hog so I was hoping that 5.5 would be better, however it seems to have
gotten worse. Previously I could run my company's test suite with -Xmx1024m
-XX:MaxPermSize=256m. Now I get:
[Error: Java heap space]
[Near : {... MyDomainObject != CE ....}]
^
[Line: 1, Column: 1]
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:308)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at
org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:435)
at
org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
at
my.company.KnowledgeBaseStatelessRuleEngine.execute(KnowledgeBaseStatelessRuleEngine.java:48)
I incrementally increased the max heap size in steps of 500m to see when the
heap error would go away and I had to go all the way up to 4000m. Is it
common knowledge that Drools requires more memory since 5.5? Is there
anything our rules could possibly be doing wrong that the newer versions
don't like?
Once I do get the tests running, I am getting a lot of errors about a
comparison to a string with the value of "null":
Exception executing consequence for rule "SomeRule_39" in
my.company.user.rules: [Error: incompatible types in statement: class
java.lang.String (compared from: class
my.company.userdata.intermediate.numbers.TotalScore)]
[Near : {... this != "null" ....}]
^
[Line: 1, Column: 1]
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)
at
my.company.commons.rules.util.KnowledgeBaseStatelessRuleEngine.execute(KnowledgeBaseStatelessRuleEngine.java:49)
Caused by: [Error: incompatible types in statement: class java.lang.String
(compared from: class my.company.userdata.intermediate.numbers.TotalScore)]
[Near : {... this != "null" ....}]
^
[Line: 1, Column: 1]
at org.mvel2.ast.BinaryOperation.<init>(BinaryOperation.java:84)
at org.mvel2.util.CompilerTools.finalizePayload(CompilerTools.java:118)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:287)
at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
at org.mvel2.MVEL.compileExpression(MVEL.java:810)
at
org.drools.base.mvel.MVELCompilationUnit.compile(MVELCompilationUnit.java:435)
at
org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:238)
at
org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:192)
at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:186)
at
my.company.user.rules.Rule_SomeRule_39_e811b8e64e174d6b84ff672feb3172d2.defaultConsequence(Rule_SomeRule_39_e811b8e64e174d6b84ff672feb3172d2.java:8)
at
my.company.user.rules.Rule_SomeRule_39_e811b8e64e174d6b84ff672feb3172d2DefaultConsequenceInvokerGenerated.evaluate(Unknown
Source)
at
my.company.user.rules.Rule_SomeRule_39_e811b8e64e174d6b84ff672feb3172d2DefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
... 37 more
I have checked my DRL sources and verified that I am not doing any null
checks, and I am certainly not doing any "null" checks either. Does anyone
out there happen to know why this error is occuring? The source for that
rule is:
rule "SomeRule_39"
when
subScore1 : SubScore1()
subScore2 : SubScore2()
subScore3 : SubScore3()
subScore4 : SubScore4()
subScore5 : SubScore5()
subScore6 : SubScore6()
subScore7 : SubScore7()
subScore8 : SubScore8()
subScore9 : SubScore9()
subScore10 : SubScore10()
then
TotalScore totalScore = new TotalScore(subScore1.getValue() +
subScore2.getValue() + subScore3.getValue() + subScore4.getValue() +
subScore5.getValue() + subScore6.getValue() + subScore7.getValue() +
subScore8.getValue() + subScore9.getValue() + subScore10.getValue());
insert(totalScore);
end
Thanks for any insight!
-DT
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-5-2-5-5-problems-tp4022168.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.