[
https://issues.jboss.org/browse/JBRULES-2821?page=com.atlassian.jira.plug...
]
Mark Proctor resolved JBRULES-2821.
-----------------------------------
Fix Version/s: 5.2.0.CR1
Resolution: Out of Date
We no longer lock at all in MVEL. Instead we also no longer set the language level,
leaving MVEL defaults on. Please re-open if this problem continues.
Race condition in MVELDialect
-----------------------------
Key: JBRULES-2821
URL:
https://issues.jboss.org/browse/JBRULES-2821
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler
Affects Versions: 5.1.1.FINAL
Environment: JDK 1.6.0_20 Mac OS X 10.6.5
Reporter: Doug Pedrick
Assignee: Mark Proctor
Fix For: 5.2.0.CR1
Multiple threads loading different rulesets (each having local copies of
KnowledgeBuilderConfiguration, KnowledgeBuilder, KnowledgeBaseConfiguration, and
KnowledgeBase) can result in a race condition with the AbstractParser.OPERATIONS hash map
in MVEL.
MVELDialect and MVELExprAnalyzer both invoke ExpressionCompiler.compile.
MVELDialect.compile calls AbstractParser.setLanguageLevel which clears and reloads the
OPERATIONS static HashMap. It does so while holding COMPILER_LOCK. MVELExprAnalyzer
calls ExpressionCompiler.compile without holding COMPILER_LOCK, resulting in OPERATIONS
sometimes being empty when called, causing an NPE when attempting to autobox an Operator
Integer to primitive.
There are other areas in Drools code that ultimately depend on OPERATIONS and should be
protected as well.
java.lang.NullPointerException
at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:250)
at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:68)
at
org.drools.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:86)
at
org.drools.rule.builder.dialect.mvel.MVELDialect.analyzeExpression(MVELDialect.java:461)
at
org.drools.rule.builder.dialect.mvel.MVELDialect.analyzeExpression(MVELDialect.java:446)
at
org.drools.rule.builder.dialect.mvel.MVELPredicateBuilder.build(MVELPredicateBuilder.java:50)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:654)
at org.drools.rule.builder.PatternBuilder.rewriteToEval(PatternBuilder.java:482)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:340)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:264)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:213)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:108)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:43)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:79)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1154)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:636)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira