[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2253) ClassNotFound when ASM optimizer kicks in in MVEL consequence
Seth Cleveland (JIRA)
jira-events at lists.jboss.org
Fri Aug 26 11:49:18 EDT 2011
[ https://issues.jboss.org/browse/JBRULES-2253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624360#comment-12624360 ]
Seth Cleveland commented on JBRULES-2253:
-----------------------------------------
The 5.2.0.Final drools version produces the failure too. See attached test case for a reproducible failure: EvaluationTests.java and fibonacci.drl. The exception occurs sooner when using fact types declared within a rules resource. The test case produces the following stack trace with the mvel2 jit enabled. However, after disabling jit, the test case passes.
These are the dependencies used:
compile "org.drools:drools-core:5.2.0.Final"
compile "org.drools:drools-compiler:5.2.0.Final"
compile "org.drools:knowledge-api:5.2.0.Final"
compile "org.mvel:mvel2:2.1.0.drools2"
compile "org.antlr:antlr:3.3"
compile "org.antlr:antlr-runtime:3.3"
compile "org.eclipse.jdt.core.compiler:ecj:3.5.1"
{noformat}
java.lang.NoClassDefFoundError: org/drools/evaluation/Fibonacci
at ASMAccessorImpl_1606342331314372823180.getValue(Unknown Source)
at org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:110)
at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:124)
at org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:33)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.MVEL.executeExpression(MVEL.java:928)
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:101)
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
at org.drools.reteoo.AlphaNode.modifyObject(AlphaNode.java:145)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:460)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:428)
at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:266)
at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:218)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:455)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:360)
at org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:210)
at org.drools.evaluation.Rule_Calculate_0.defaultConsequence(Rule_Calculate_0.java:22)
at org.drools.evaluation.Rule_Calculate_0DefaultConsequenceInvoker.evaluate(Rule_Calculate_0DefaultConsequenceInvoker.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at org.drools.EvaluationTests.test(EvaluationTests.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.drools.evaluation.Fibonacci
at java.lang.ClassLoader.findClass(ClassLoader.java:359)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 49 more
{noformat}
> ClassNotFound when ASM optimizer kicks in in MVEL consequence
> -------------------------------------------------------------
>
> Key: JBRULES-2253
> URL: https://issues.jboss.org/browse/JBRULES-2253
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core
> Affects Versions: 5.0.1.FINAL
> Reporter: Michael Neale
> Assignee: Tihomir Surdilovic
> Priority: Critical
> Fix For: 5.3.0.CR1
>
> Attachments: EvaluationTests.java, fibonacci.drl, repository_export_mic.zip
>
>
> (ok if the subject is really confusing, perhaps this bug isn't for you).
> In chasing down JBRULES-2234 I found this. Instructions (apologies for relying on Guvnor to reproduce):
> To reproduce is not
> easy, but here are some instructions:
> * Run latest Guvnor (if you are able to, if not, then the rest is moot !).
> * Import the attached repo (unzip it first).
> * browse to KnowledgeBases/org/acme/insurance/pricing/
> - press "build package"
> * shut it down, restart (flushes caches etc...)
> Then:
> * browse to KnowledgeBases/org/acme/insurance/pricing/Test Scenarios
> * open PolicyQuotePackageTest
> * run it:
> Now you should see an exception like this:
> Caused by: java.lang.NoClassDefFoundError: org/acme/insurance/Policy
> at ASMAccessorImpl_62408281250565694450.setValue(Unknown Source)
> at org.mvel2.optimizers.dynamic.DynamicSetAccessor.setValue(DynamicSetAccessor.java:74)
> at org.mvel2.compiler.CompiledAccExpression.setValue(CompiledAccExpression.java:47)
> at org.mvel2.MVEL.executeSetExpression(MVEL.java:962)
> at org.mvel2.ast.WithNode$ParmValuePair.eval(WithNode.java:242)
> at org.mvel2.ast.WithNode.getReducedValueAccelerated(WithNode.java:67)
> at org.mvel2.ast.InterceptorWrapper.getReducedValueAccelerated(InterceptorWrapper.java:38)
> at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
> at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:104)
> at org.mvel2.MVEL.executeExpression(MVEL.java:995)
> at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:91)
> at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:966)
> This is due to it loading a previously serialized version of the KB.
> If it was to run off a freshly compiled one, its all fine. Also, if I
> tell MVEL to NOT use ASM optimizer, it works fine (using reflection).
> So clearly the stuff is available to the classpath in the right
> places... its only to do with ASM in mvel post deserialization. (and
> for that to happen, MVEL has to execute the compiled expression enough
> to kick in the JIT).
> MVELCompilationUnit in drools is worth examining too... still not sure where the problem lies.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list