Occasional ClassCastException when firing rules

View: New views
9 Messages — Rating Filter:   Alert me  

Occasional ClassCastException when firing rules

by seemamani () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

We are using Drools 4.0.7 in a web application deployed in WebSphere 6.1.  Occasionally, we have rule engine failure caused by RuntimeDroolsException (whose root cause is shown as ClassCastException) when firing rules. Other times, the rules are executing without errors. Here is the stack trace of the exception. What are the possible reasons?

Thanks,
Seema

org.drools.RuntimeDroolsException: Exception executing predicate eval( inventory.leaseInformation != null )
        at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
        at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
        at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
        at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
        at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
        at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
        at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
        at com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
        at com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
        at com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
        at com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
        at com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:618)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
        at com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
        at com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
        at com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
        at com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
        at com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
        at com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
        at com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:618)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
        at com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:618)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
        at com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
        at com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
        at com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
        at com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
        at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
        at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Caused by:
java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory incompatible with com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown Source)
        at org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
        at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
        at org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
        at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
        at org.mvel.MVEL.executeExpression(MVEL.java:235)
        at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
        at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)

Re: ClassCastException when firing rules

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


   What are you guys doing with CGLIB? or is this WebSphere doing some sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?

Caused by:
java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
incompatible with
com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3

   At compile time we determine that "inventory" is a com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into the expression is a com.adesa.data.grounding.pojo.
Inventory$$EnhancerByCGLIB$$de81aab3, and it is not a proper subclass, you might get such problems.

   Having said that, I will talk to Mike to check if this can be prevented somehow, but I really don't know if it will be possible...

   []s
   Edson



2008/11/25 seemamani <seemamani@...>

hi,

We are using Drools 4.0.7 in a web application deployed in WebSphere 6.1.
Occasionally, we have rule engine failure caused by RuntimeDroolsException
(whose root cause is shown as ClassCastException) when firing rules. Other
times, the rules are executing without errors. Here is the stack trace of
the exception. What are the possible reasons?

Thanks,
Seema

org.drools.RuntimeDroolsException: Exception executing predicate eval(
inventory.leaseInformation != null )
       at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
       at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
       at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
       at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
       at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
       at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
       at org.drools.reteoo.Rete.assertObject(Rete.java:175)
       at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
       at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
       at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
       at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
       at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
       at
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
       at
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
       at
com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
       at
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
       at
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
       at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:618)
       at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
       at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
       at
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
       at
com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
       at
com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
       at
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
       at
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
       at
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
       at
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
       at
com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
       at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:618)
       at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
       at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
       at
com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
       at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:618)
       at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
       at
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
       at
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
       at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
       at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
       at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
       at
com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
       at
com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
       at
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
       at
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
       at
com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
       at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
       at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
       at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
       at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
       at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
       at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
       at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
       at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Caused by:
java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
incompatible with
com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
       at ASMAccessorImpl_11448003161226563261710.getValue(Unknown Source)
       at
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
       at
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
       at
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
       at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
       at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
       at org.mvel.MVEL.executeExpression(MVEL.java:235)
       at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
       at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
--
View this message in context: http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p20694738.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: ClassCastException when firing rules

by seemamani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Edson,

We are not sure how the CGLIB proxy is getting created. We were under the impression that it is the shadow fact proxy generated by Drools itself. I would like to share a few more points about our application in case they are somehow related to this problem.

1. We are using Spring AOP for intercepting method calls and passing the facts, globals etc to a class that invoke Drools. Version of Spring is 2.0.7
2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory POJO that is causing the ClassCastException is a JPA entity
3. We have rules defined in multiple packages. The Inventory POJO is used by rules in all the packages. But the exception is occurring only for rules in a particular package. That too only occasionally.

Please let me know if any other information is required.

Thanks,
Seema

Edson Tirelli-3 wrote:
   What are you guys doing with CGLIB? or is this WebSphere doing some
sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?

Caused by:
java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
incompatible with
com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3

   At compile time we determine that "inventory" is a
com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into the
expression is a
com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
and it is not a proper subclass, you might get such problems.

   Having said that, I will talk to Mike to check if this can be prevented
somehow, but I really don't know if it will be possible...

   []s
   Edson



2008/11/25 seemamani <seemamani@gmail.com>

>
> hi,
>
> We are using Drools 4.0.7 in a web application deployed in WebSphere 6.1.
> Occasionally, we have rule engine failure caused by RuntimeDroolsException
> (whose root cause is shown as ClassCastException) when firing rules. Other
> times, the rules are executing without errors. Here is the stack trace of
> the exception. What are the possible reasons?
>
> Thanks,
> Seema
>
> org.drools.RuntimeDroolsException: Exception executing predicate eval(
> inventory.leaseInformation != null )
>        at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>        at
>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>        at
>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>        at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>        at
> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>        at
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
>        at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
>        at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
>        at
>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
>        at
>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
>        at
>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
>        at
>
> com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
>        at
>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
>        at
>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:618)
>        at
>

> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
>        at
>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
>        at
>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
>        at
>
> com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
>        at
>
> com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
>        at
>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
>        at
>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
>        at
>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
>        at
>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
>        at
>
> com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:618)
>        at
>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>        at
>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
>        at
>
> com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>        at java.lang.reflect.Method.invoke(Method.java:618)
>        at
>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
>        at
>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
>        at
>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
>        at
>
> com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
>        at
>
> com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
>        at
>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
>        at
>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
>        at
>
> com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
>        at
> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> Caused by:
> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> incompatible with
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown Source)
>        at
>
> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
>        at
>
> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
>        at
>
> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
>        at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
>        at
>
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
>        at
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
> --
> View this message in context:
> http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p20694738.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: ClassCastException when firing rules

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     Hi Seema,

     Your rules look fine, and the reason you see an "eval" in the exception text is that this:

 inventory.leaseInformation != null

     Is resolved as an eval.

     Anyway, drools does *not* use CGLIB. We generate bytecode directly using ASM. No CGLIB in the middle.

     The problem, whatever it is, is related to the pojo model and any of these frameworks interfering with it. So, if you can create an isolated test case that allow us to reproduce the problem, it will help us understand how can we support your scenario of usage.

     Thanks,
         Edson

2008/11/26 seemamani <seemamani@...>

Edson,

We are not sure how the CGLIB proxy is getting created. We were under the
impression that it is the shadow fact proxy generated by Drools itself. I
would like to share a few more points about our application in case they are
somehow related to this problem.

1. We are using Spring AOP for intercepting method calls and passing the
facts, globals etc to a class that invoke Drools. Version of Spring is 2.0.7
2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
POJO that is causing the ClassCastException is a JPA entity
3. We have rules defined in multiple packages. The Inventory POJO is used by
rules in all the packages. But the exception is occurring only for rules in
a particular package. That too only occasionally.

Please let me know if any other information is required.

Thanks,
Seema


Edson Tirelli-3 wrote:
>
>    What are you guys doing with CGLIB? or is this WebSphere doing some
> sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
>
> Caused by:
> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> incompatible with
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>
>    At compile time we determine that "inventory" is a
> com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
> the
> expression is a
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
> and it is not a proper subclass, you might get such problems.
>
>    Having said that, I will talk to Mike to check if this can be prevented
> somehow, but I really don't know if it will be possible...
>
>    []s
>    Edson
>
>
>
> 2008/11/25 seemamani <seemamani@...>
>
>>
>> hi,
>>
>> We are using Drools 4.0.7 in a web application deployed in WebSphere 6.1.
>> Occasionally, we have rule engine failure caused by
>> RuntimeDroolsException
>> (whose root cause is shown as ClassCastException) when firing rules.
>> Other
>> times, the rules are executing without errors. Here is the stack trace of
>> the exception. What are the possible reasons?
>>
>> Thanks,
>> Seema
>>
>> org.drools.RuntimeDroolsException: Exception executing predicate eval(
>> inventory.leaseInformation != null )
>>        at
>> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>>        at
>>
>> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>        at
>>
>> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>>        at
>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>>        at
>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>>        at
>> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
>>        at
>>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
>>        at
>>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
>>        at
>>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
>>        at
>>
>> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
>>        at
>>
>> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
>>        at
>>
>> com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
>>        at
>>
>> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
>>        at
>>
>> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
>>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
>>        at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>
>> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
>>        at
>>
>> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
>>        at
>>
>> com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
>>        at
>>
>> com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
>>        at
>>
>> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
>>        at
>>
>> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
>>        at
>>
>> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
>>        at
>>
>> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
>>        at
>>
>> com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
>>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
>>        at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>>        at
>>
>> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
>>        at
>>
>> com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
>>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
>>        at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
>>        at
>>
>> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
>>        at
>>
>> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>>        at
>>
>> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
>>        at
>>
>> com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
>>        at
>>
>> com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
>>        at
>>
>> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
>>        at
>>
>> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
>>        at
>>
>> com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
>>        at
>> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
>>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
>>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
>>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
>>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
>> Caused by:
>> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
>> incompatible with
>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
>> Source)
>>        at
>>
>> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
>>        at
>>
>> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
>>        at
>>
>> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
>>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
>>        at
>> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
>>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
>>        at
>>
>> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
>>        at
>> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
>> --
>> View this message in context:
>> http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p20694738.html
>> Sent from the drools - user mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@...
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

--
View this message in context: http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20694738p20705144.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: ClassCastException when firing rules

by seemamani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Edson,

Thanks for your reply. Reproducing the error looks difficult since it happens only at times, but we will try. However, I noticed a bug reported in your JIRA which also has reported a similar ClassCastException with a CGLIB proxy.
https://jira.jboss.org/jira/browse/JBRULES-1784
It says that the bug has been fixed in version 5.0 of Drools. But it does not mention the environment in which it was tested, so can't be sure if it is related to our case.

Thanks,
Seema


Edson Tirelli-3 wrote:
     Hi Seema,

     Your rules look fine, and the reason you see an "eval" in the exception
text is that this:

 inventory.leaseInformation != null

     Is resolved as an eval.

     Anyway, drools does *not* use CGLIB. We generate bytecode directly
using ASM. No CGLIB in the middle.

     The problem, whatever it is, is related to the pojo model and any of
these frameworks interfering with it. So, if you can create an isolated test
case that allow us to reproduce the problem, it will help us understand how
can we support your scenario of usage.

     Thanks,
         Edson

2008/11/26 seemamani <seemamani@gmail.com>

>
> Edson,
>
> We are not sure how the CGLIB proxy is getting created. We were under the
> impression that it is the shadow fact proxy generated by Drools itself. I
> would like to share a few more points about our application in case they
> are
> somehow related to this problem.
>
> 1. We are using Spring AOP for intercepting method calls and passing the
> facts, globals etc to a class that invoke Drools. Version of Spring is
> 2.0.7
> 2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
> POJO that is causing the ClassCastException is a JPA entity
> 3. We have rules defined in multiple packages. The Inventory POJO is used
> by
> rules in all the packages. But the exception is occurring only for rules in
> a particular package. That too only occasionally.
>
> Please let me know if any other information is required.
>
> Thanks,
> Seema
>
>
> Edson Tirelli-3 wrote:
> >
> >    What are you guys doing with CGLIB? or is this WebSphere doing some
> > sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
> >
> > Caused by:
> > java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> > incompatible with
> > com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
> >
> >    At compile time we determine that "inventory" is a
> > com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
> > the
> > expression is a
> > com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
> > and it is not a proper subclass, you might get such problems.
> >
> >    Having said that, I will talk to Mike to check if this can be
> prevented
> > somehow, but I really don't know if it will be possible...
> >
> >    []s
> >    Edson
> >
> >
> >
> > 2008/11/25 seemamani <seemamani@gmail.com>
> >
> >>
> >> hi,
> >>
> >> We are using Drools 4.0.7 in a web application deployed in WebSphere
> 6.1.
> >> Occasionally, we have rule engine failure caused by
> >> RuntimeDroolsException
> >> (whose root cause is shown as ClassCastException) when firing rules.
> >> Other
> >> times, the rules are executing without errors. Here is the stack trace
> of
> >> the exception. What are the possible reasons?
> >>
> >> Thanks,
> >> Seema
> >>
> >> org.drools.RuntimeDroolsException: Exception executing predicate eval(
> >> inventory.leaseInformation != null )
> >>        at
> >>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
> >>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
> >>        at
> >>
> >>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
> >>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
> >>        at
> >>
> >>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
> >>        at
> >> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
> >>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> >>        at
> >> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
> >>        at
> >>
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
> >>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
> >>        at
> >>
> >>
> com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
> >>        at
> >>
> >>
> com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
> >>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >>        at
> >>
> >>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
> >>        at
> >>
> >>
> com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
> >>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
> >>        at
> >>
> >>
> com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
> >>        at
> >> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
> >>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
> >>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
> >>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
> >>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
> >>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
> >>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
> >>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> >> Caused by:
> >> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> >> incompatible with
> >> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
> >>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
> >> Source)
> >>        at
> >>
> >>
> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
> >>        at
> >>
> >>
> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
> >>        at
> >>
> >>
> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
> >>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
> >>        at
> >> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
> >>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
> >>        at
> >>
> >>
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
> >>        at
> >>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p20694738.html
> >> Sent from the drools - user mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> >  Edson Tirelli
> >  JBoss Drools Core Development
> >  JBoss, a division of Red Hat @ www.jboss.com
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20694738p20705144.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

RE: ClassCastException when firing rules

by Dean Turner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

FYI: Spring AOP enhances objects via CGLIB when no interface is available.
If an interface is avaiable, it uses an jdk dynamic proxy.  

-----Original Message-----
From: rules-users-bounces@...
[mailto:rules-users-bounces@...] On Behalf Of seemamani
Sent: Wednesday, November 26, 2008 11:18 AM
To: rules-users@...
Subject: Re: [rules-users] ClassCastException when firing rules


Edson,

We are not sure how the CGLIB proxy is getting created. We were under the
impression that it is the shadow fact proxy generated by Drools itself. I
would like to share a few more points about our application in case they
are
somehow related to this problem.

1. We are using Spring AOP for intercepting method calls and passing the
facts, globals etc to a class that invoke Drools. Version of Spring is
2.0.7
2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
POJO that is causing the ClassCastException is a JPA entity
3. We have rules defined in multiple packages. The Inventory POJO is used
by
rules in all the packages. But the exception is occurring only for rules
in
a particular package. That too only occasionally.

Please let me know if any other information is required.

Thanks,
Seema


Edson Tirelli-3 wrote:

>
>    What are you guys doing with CGLIB? or is this WebSphere doing some
> sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
>
> Caused by:
> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> incompatible with
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>
>    At compile time we determine that "inventory" is a
> com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
> the
> expression is a
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
> and it is not a proper subclass, you might get such problems.
>
>    Having said that, I will talk to Mike to check if this can be
prevented

> somehow, but I really don't know if it will be possible...
>
>    []s
>    Edson
>
>
>
> 2008/11/25 seemamani <seemamani@...>
>
>>
>> hi,
>>
>> We are using Drools 4.0.7 in a web application deployed in WebSphere
6.1.
>> Occasionally, we have rule engine failure caused by
>> RuntimeDroolsException
>> (whose root cause is shown as ClassCastException) when firing rules.
>> Other
>> times, the rules are executing without errors. Here is the stack trace
of
>> the exception. What are the possible reasons?
>>
>> Thanks,
>> Seema
>>
>> org.drools.RuntimeDroolsException: Exception executing predicate eval(
>> inventory.leaseInformation != null )
>>        at
>>
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216
)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>>        at
>>
>>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>        at
>>
>>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
>>        at
>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>>        at
>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>>        at
>>
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71
)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
911)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
883)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
684)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.i
nit(ManagedStatefulSession.java:87)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.f
ireAllRules(ManagedStatefulSession.java:100)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(R
uleEngineImpl.java:60)
>>        at
>>
>>
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnot
edRules(RulesInterceptor.java:109)
>>        at
>>
>>
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules
(RulesInterceptor.java:80)
>>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
.intercept(Cglib2AopProxy.java:629)
>>        at
>>
>>
com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdateP
ricing(<generated>)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(Sale
EventManagerImpl.java:2599)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuct
ion(SaleEventManagerImpl.java:1993)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1180)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1134)
>>        at
>>
>>
com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGround
ingSaleEvent(AuctionServiceImpl.java:766)
>>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ao
pUtils.java:304)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoi
nt(ReflectiveMethodInvocation.java:182)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:149)
>>        at
>>
>>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
TransactionInterceptor.java:106)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.procee
d(MethodInvocationProceedingJoinPoint.java:77)
>>        at
>>
>>
com.adesa.business.framework.logging.LoggingInterceptor.profileLog(Logging
Interceptor.java:136)
>>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.
invoke(AfterReturningAdviceInterceptor.java:50)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.in
voke(MethodBeforeAdviceInterceptor.java:50)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopP
roxy.java:204)
>>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
>>        at
>>
>>
com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java
:112)
>>        at
>>
>>
com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMB
PPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
>>        at
>>
>>
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.upd
ateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
>>        at
>>
>>
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._in
voke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
>>        at
>>
>>
com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.jav
a:621)

>>        at
>> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
>>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
>>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
>>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
>>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
>> Caused by:
>> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
>> incompatible with
>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
>> Source)
>>        at
>>
>>
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableD
eepPropertyNode.java:22)
>>        at
>>
>>
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.ja
va:21)
>>        at
>>
>>
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.ja
va:21)
>>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
>>        at
>> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
>>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
>>        at
>>
>>
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpress
ion.java:45)
>>        at
>>
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209
)
>> --
>> View this message in context:
>>
http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p2069
4738.html

>> Sent from the drools - user mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@...
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

--
View this message in context:
http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20
694738p20705144.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

RE: ClassCastException when firing rules

by seemamani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Dean, we have removed the AOP implementation to check if that is the source of the problem.

Edson, Is there any chance for a ClassCastException if the fact classes in the application were changed, but the fact model classes that are part of the compiled rule package were not updated to the most recent version? But then it would cause exceptions consistently, right? In our case, the exceptions are thrown occasionally only.

Thanks,
Seema

Dean Turner wrote:
FYI: Spring AOP enhances objects via CGLIB when no interface is available.
If an interface is avaiable, it uses an jdk dynamic proxy.  

-----Original Message-----
From: rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of seemamani
Sent: Wednesday, November 26, 2008 11:18 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] ClassCastException when firing rules


Edson,

We are not sure how the CGLIB proxy is getting created. We were under the
impression that it is the shadow fact proxy generated by Drools itself. I
would like to share a few more points about our application in case they
are
somehow related to this problem.

1. We are using Spring AOP for intercepting method calls and passing the
facts, globals etc to a class that invoke Drools. Version of Spring is
2.0.7
2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
POJO that is causing the ClassCastException is a JPA entity
3. We have rules defined in multiple packages. The Inventory POJO is used
by
rules in all the packages. But the exception is occurring only for rules
in
a particular package. That too only occasionally.

Please let me know if any other information is required.

Thanks,
Seema


Edson Tirelli-3 wrote:
>
>    What are you guys doing with CGLIB? or is this WebSphere doing some
> sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
>
> Caused by:
> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> incompatible with
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>
>    At compile time we determine that "inventory" is a
> com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
> the
> expression is a
> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
> and it is not a proper subclass, you might get such problems.
>
>    Having said that, I will talk to Mike to check if this can be
prevented
> somehow, but I really don't know if it will be possible...
>
>    []s
>    Edson
>
>
>
> 2008/11/25 seemamani <seemamani@gmail.com>
>
>>
>> hi,
>>
>> We are using Drools 4.0.7 in a web application deployed in WebSphere
6.1.
>> Occasionally, we have rule engine failure caused by
>> RuntimeDroolsException
>> (whose root cause is shown as ClassCastException) when firing rules.
>> Other
>> times, the rules are executing without errors. Here is the stack trace
of
>> the exception. What are the possible reasons?
>>
>> Thanks,
>> Seema
>>
>> org.drools.RuntimeDroolsException: Exception executing predicate eval(
>> inventory.leaseInformation != null )
>>        at
>>
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216
)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>>        at
>>
>>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>        at
>>
>>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
teObjectSinkAdapter.java:318)
>>        at
>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>>        at
>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>>        at
>>
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71
)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
911)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
883)
>>        at
>>
>>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
684)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.i
nit(ManagedStatefulSession.java:87)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.f
ireAllRules(ManagedStatefulSession.java:100)
>>        at
>>
>>
com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(R
uleEngineImpl.java:60)
>>        at
>>
>>
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnot
edRules(RulesInterceptor.java:109)
>>        at
>>
>>
com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules
(RulesInterceptor.java:80)
>>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
.intercept(Cglib2AopProxy.java:629)
>>        at
>>
>>
com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdateP
ricing(<generated>)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(Sale
EventManagerImpl.java:2599)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuct
ion(SaleEventManagerImpl.java:1993)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1180)
>>        at
>>
>>
com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
ndingSaleEvent(SaleEventManagerImpl.java:1134)
>>        at
>>
>>
com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGround
ingSaleEvent(AuctionServiceImpl.java:766)
>>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ao
pUtils.java:304)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoi
nt(ReflectiveMethodInvocation.java:182)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:149)
>>        at
>>
>>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
TransactionInterceptor.java:106)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.procee
d(MethodInvocationProceedingJoinPoint.java:77)
>>        at
>>
>>
com.adesa.business.framework.logging.LoggingInterceptor.profileLog(Logging
Interceptor.java:136)
>>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
>>        at
>>
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
pl.java:43)
>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
thGivenArgs(AbstractAspectJAdvice.java:597)
>>        at
>>
>>
org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
bstractAspectJAdvice.java:583)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
vice.java:60)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.
invoke(AfterReturningAdviceInterceptor.java:50)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.in
voke(MethodBeforeAdviceInterceptor.java:50)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
fterThrowingAdvice.java:54)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
oseInvocationInterceptor.java:89)
>>        at
>>
>>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
ctiveMethodInvocation.java:171)
>>        at
>>
>>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopP
roxy.java:204)
>>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
>>        at
>>
>>
com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java
:112)
>>        at
>>
>>
com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMB
PPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
>>        at
>>
>>
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.upd
ateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
>>        at
>>
>>
com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._in
voke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
>>        at
>>
>>
com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.jav
a:621)
>>        at
>> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
>>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
>>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
>>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
>>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
>> Caused by:
>> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
>> incompatible with
>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
>> Source)
>>        at
>>
>>
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableD
eepPropertyNode.java:22)
>>        at
>>
>>
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.ja
va:21)
>>        at
>>
>>
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.ja
va:21)
>>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
>>        at
>> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
>>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
>>        at
>>
>>
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpress
ion.java:45)
>>        at
>>
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209
)
>> --
>> View this message in context:
>>
http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p2069
4738.html
>> Sent from the drools - user mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>  Edson Tirelli
>  JBoss Drools Core Development
>  JBoss, a division of Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

--
View this message in context:
http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20
694738p20705144.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: ClassCastException when firing rules

by Edson Tirelli-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


   Yes, that is correct. If the underlying class interface changed, java will raise CCE. Rulebase must be recompiled in that case.

   []s
   Edson

2008/12/2 seemamani <seemamani@...>

Thanks Dean, we have removed the AOP implementation to check if that is the
source of the problem.

Edson, Is there any chance for a ClassCastException if the fact classes in
the application were changed, but the fact model classes that are part of
the compiled rule package were not updated to the most recent version? But
then it would cause exceptions consistently, right? In our case, the
exceptions are thrown occasionally only.

Thanks,
Seema


Dean Turner wrote:
>
> FYI: Spring AOP enhances objects via CGLIB when no interface is available.
> If an interface is avaiable, it uses an jdk dynamic proxy.
>
> -----Original Message-----
> From: rules-users-bounces@...
> [mailto:rules-users-bounces@...] On Behalf Of seemamani
> Sent: Wednesday, November 26, 2008 11:18 AM
> To: rules-users@...
> Subject: Re: [rules-users] ClassCastException when firing rules
>
>
> Edson,
>
> We are not sure how the CGLIB proxy is getting created. We were under the
> impression that it is the shadow fact proxy generated by Drools itself. I
> would like to share a few more points about our application in case they
> are
> somehow related to this problem.
>
> 1. We are using Spring AOP for intercepting method calls and passing the
> facts, globals etc to a class that invoke Drools. Version of Spring is
> 2.0.7
> 2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
> POJO that is causing the ClassCastException is a JPA entity
> 3. We have rules defined in multiple packages. The Inventory POJO is used
> by
> rules in all the packages. But the exception is occurring only for rules
> in
> a particular package. That too only occasionally.
>
> Please let me know if any other information is required.
>
> Thanks,
> Seema
>
>
> Edson Tirelli-3 wrote:
>>
>>    What are you guys doing with CGLIB? or is this WebSphere doing some
>> sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
>>
>> Caused by:
>> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
>> incompatible with
>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>>
>>    At compile time we determine that "inventory" is a
>> com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
>> the
>> expression is a
>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
>> and it is not a proper subclass, you might get such problems.
>>
>>    Having said that, I will talk to Mike to check if this can be
> prevented
>> somehow, but I really don't know if it will be possible...
>>
>>    []s
>>    Edson
>>
>>
>>
>> 2008/11/25 seemamani <seemamani@...>
>>
>>>
>>> hi,
>>>
>>> We are using Drools 4.0.7 in a web application deployed in WebSphere
> 6.1.
>>> Occasionally, we have rule engine failure caused by
>>> RuntimeDroolsException
>>> (whose root cause is shown as ClassCastException) when firing rules.
>>> Other
>>> times, the rules are executing without errors. Here is the stack trace
> of
>>> the exception. What are the possible reasons?
>>>
>>> Thanks,
>>> Seema
>>>
>>> org.drools.RuntimeDroolsException: Exception executing predicate eval(
>>> inventory.leaseInformation != null )
>>>        at
>>>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216
> )
>>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>>>        at
>>>
>>>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
> teObjectSinkAdapter.java:318)
>>>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>>        at
>>>
>>>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composi
> teObjectSinkAdapter.java:318)
>>>        at
>>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>>>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>>>        at
>>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>>>        at
>>>
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71
> )
>>>        at
>>>
>>>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
> 911)
>>>        at
>>>
>>>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
> 883)
>>>        at
>>>
>>>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:
> 684)
>>>        at
>>>
>>>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.i
> nit(ManagedStatefulSession.java:87)
>>>        at
>>>
>>>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.f
> ireAllRules(ManagedStatefulSession.java:100)
>>>        at
>>>
>>>
> com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(R
> uleEngineImpl.java:60)
>>>        at
>>>
>>>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnot
> edRules(RulesInterceptor.java:109)
>>>        at
>>>
>>>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules
> (RulesInterceptor.java:80)
>>>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
>>>        at
>>>
>>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:43)
>>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>>        at
>>>
>>
>>>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
> thGivenArgs(AbstractAspectJAdvice.java:597)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
> bstractAspectJAdvice.java:583)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
> vice.java:60)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
> oseInvocationInterceptor.java:89)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor
> .intercept(Cglib2AopProxy.java:629)
>>>        at
>>>
>>>
> com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdateP
> ricing(<generated>)
>>>        at
>>>
>>>
> com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(Sale
> EventManagerImpl.java:2599)
>>>        at
>>>
>>>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuct
> ion(SaleEventManagerImpl.java:1993)
>>>        at
>>>
>>>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
> ndingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
>>>        at
>>>
>>>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
> ndingSaleEvent(SaleEventManagerImpl.java:1180)
>>>        at
>>>
>>>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGrou
> ndingSaleEvent(SaleEventManagerImpl.java:1134)
>>>        at
>>>
>>>
> com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGround
> ingSaleEvent(AuctionServiceImpl.java:766)
>>>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
>>>        at
>>>
>>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:43)
>>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>>        at
>>>
>>>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ao
> pUtils.java:304)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoi
> nt(ReflectiveMethodInvocation.java:182)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:149)
>>>        at
>>>
>>>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
> TransactionInterceptor.java:106)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.procee
> d(MethodInvocationProceedingJoinPoint.java:77)
>>>        at
>>>
>>>
> com.adesa.business.framework.logging.LoggingInterceptor.profileLog(Logging
> Interceptor.java:136)
>>>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
>>>        at
>>>
>>>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:43)
>>>        at java.lang.reflect.Method.invoke(Method.java:618)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWi
> thGivenArgs(AbstractAspectJAdvice.java:597)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(A
> bstractAspectJAdvice.java:583)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAd
> vice.java:60)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.
> invoke(AfterReturningAdviceInterceptor.java:50)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
> fterThrowingAdvice.java:54)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.in
> voke(MethodBeforeAdviceInterceptor.java:50)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJA
> fterThrowingAdvice.java:54)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Exp
> oseInvocationInterceptor.java:89)
>>>        at
>>>
>>>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Refle
> ctiveMethodInvocation.java:171)
>>>        at
>>>
>>>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopP
> roxy.java:204)
>>>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
>>>        at
>>>
>>>
> com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java
> :112)
>>>        at
>>>
>>>
> com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMB
> PPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
>>>        at
>>>
>>>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.upd
> ateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
>>>        at
>>>
>>>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._in
> voke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
>>>        at
>>>
>>>
> com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.jav
> a:621)
>>>        at
>>> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
>>>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
>>>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
>>>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
>>>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
>>>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
>>>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
>>>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
>>> Caused by:
>>> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
>>> incompatible with
>>> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
>>>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
>>> Source)
>>>        at
>>>
>>>
> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableD
> eepPropertyNode.java:22)
>>>        at
>>>
>>>
> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.ja
> va:21)
>>>        at
>>>
>>>
> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.ja
> va:21)
>>>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
>>>        at
>>> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
>>>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
>>>        at
>>>
>>>
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpress
> ion.java:45)
>>>        at
>>>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209
> )
>>> --
>>> View this message in context:
>>>
> http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p2069
> 4738.html
>>> Sent from the drools - user mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> rules-users mailing list
>>> rules-users@...
>>> https://lists.jboss.org/mailman/listinfo/rules-users
>>>
>>
>>
>>
>> --
>>  Edson Tirelli
>>  JBoss Drools Core Development
>>  JBoss, a division of Red Hat @ www.jboss.com
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@...
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20
> 694738p20705144.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
> _______________________________________________
> rules-users mailing list
> rules-users@...
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

--
View this message in context: http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20694738p20794410.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@...
https://lists.jboss.org/mailman/listinfo/rules-users

Re: ClassCastException when firing rules

by seemamani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi Edson.

This is in continuation with the below issue that I had posted a few months back. Even though we removed Spring AOP from the application then, the problem still occurs at times. I was wondering if Hibernate was the culprit, but fail to understand why it is not consistently happening.

The Inventory object which is causing the ClassCastException is a Hibernate proxy since it is lazy loaded. The injected fact contains a reference to this Inventory. So I was wondering if the issue has something to do with shadow fact creation. When the shadow is created for a fact that contains a Hibernate proxy, is there any possibility of this problem?

Thanks,
Seema


Edson Tirelli-3 wrote:
     Hi Seema,

     Your rules look fine, and the reason you see an "eval" in the exception
text is that this:

 inventory.leaseInformation != null

     Is resolved as an eval.

     Anyway, drools does *not* use CGLIB. We generate bytecode directly
using ASM. No CGLIB in the middle.

     The problem, whatever it is, is related to the pojo model and any of
these frameworks interfering with it. So, if you can create an isolated test
case that allow us to reproduce the problem, it will help us understand how
can we support your scenario of usage.

     Thanks,
         Edson

2008/11/26 seemamani <seemamani@gmail.com>

>
> Edson,
>
> We are not sure how the CGLIB proxy is getting created. We were under the
> impression that it is the shadow fact proxy generated by Drools itself. I
> would like to share a few more points about our application in case they
> are
> somehow related to this problem.
>
> 1. We are using Spring AOP for intercepting method calls and passing the
> facts, globals etc to a class that invoke Drools. Version of Spring is
> 2.0.7
> 2. We are using Hibernate 3.x/JPA for persistence. In fact the Inventory
> POJO that is causing the ClassCastException is a JPA entity
> 3. We have rules defined in multiple packages. The Inventory POJO is used
> by
> rules in all the packages. But the exception is occurring only for rules in
> a particular package. That too only occasionally.
>
> Please let me know if any other information is required.
>
> Thanks,
> Seema
>
>
> Edson Tirelli-3 wrote:
> >
> >    What are you guys doing with CGLIB? or is this WebSphere doing some
> > sneaky thing behind the scenes? Or is it SpringAOP doing sneaky things?
> >
> > Caused by:
> > java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> > incompatible with
> > com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
> >
> >    At compile time we determine that "inventory" is a
> > com.adesa.data.grounding.pojo.Inventory. If at runtime what arrives into
> > the
> > expression is a
> > com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3,
> > and it is not a proper subclass, you might get such problems.
> >
> >    Having said that, I will talk to Mike to check if this can be
> prevented
> > somehow, but I really don't know if it will be possible...
> >
> >    []s
> >    Edson
> >
> >
> >
> > 2008/11/25 seemamani <seemamani@gmail.com>
> >
> >>
> >> hi,
> >>
> >> We are using Drools 4.0.7 in a web application deployed in WebSphere
> 6.1.
> >> Occasionally, we have rule engine failure caused by
> >> RuntimeDroolsException
> >> (whose root cause is shown as ClassCastException) when firing rules.
> >> Other
> >> times, the rules are executing without errors. Here is the stack trace
> of
> >> the exception. What are the possible reasons?
> >>
> >> Thanks,
> >> Seema
> >>
> >> org.drools.RuntimeDroolsException: Exception executing predicate eval(
> >> inventory.leaseInformation != null )
> >>        at
> >>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)
> >>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
> >>        at
> >>
> >>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
> >>        at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
> >>        at
> >>
> >>
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
> >>        at
> >> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
> >>        at org.drools.reteoo.Rete.assertObject(Rete.java:175)
> >>        at
> >> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
> >>        at
> >>
> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
> >>        at
> >>
> >>
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.init(ManagedStatefulSession.java:87)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.ManagedStatefulSession.fireAllRules(ManagedStatefulSession.java:100)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.process.drools.RuleEngineImpl.execute(RuleEngineImpl.java:60)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyAnnotedRules(RulesInterceptor.java:109)
> >>        at
> >>
> >>
> com.adesa.business.framework.rules.interceptor.RulesInterceptor.applyRules(RulesInterceptor.java:80)
> >>        at sun.reflect.GeneratedMethodAccessor575.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
> >>        at
> >>
> >>
> com.adesa.business.rules.RuleHandler$$EnhancerByCGLIB$$3ab6eda.fireUpdatePricing(<generated>)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.updatePricing(SaleEventManagerImpl.java:2599)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfAuction(SaleEventManagerImpl.java:1993)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEventForHyundai(SaleEventManagerImpl.java:1783)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1180)
> >>        at
> >>
> >>
> com.adesa.business.auction.manager.SaleEventManagerImpl.cascadeAtEndOfGroundingSaleEvent(SaleEventManagerImpl.java:1134)
> >>        at
> >>
> >>
> com.adesa.business.auction.service.AuctionServiceImpl.cascadeAtEndOfGroundingSaleEvent(AuctionServiceImpl.java:766)
> >>        at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >>        at
> >>
> >>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
> >>        at
> >>
> >>
> com.adesa.business.framework.logging.LoggingInterceptor.profileLog(LoggingInterceptor.java:136)
> >>        at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
> >>        at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>        at java.lang.reflect.Method.invoke(Method.java:618)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:597)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:583)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:60)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >>        at
> >>
> >>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >>        at
> >>
> >>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >>        at $Proxy58.cascadeAtEndOfGroundingSaleEvent(Unknown Source)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb.PricingBean.updateMBPPrice(PricingBean.java:112)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb.EJSRemoteStatelessPricing_a0966b04.updateMBPPrice(EJSRemoteStatelessPricing_a0966b04.java:183)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie.updateMBPPrice(_EJSRemoteStatelessPricing_a0966b04_Tie.java:243)
> >>        at
> >>
> >>
> com.adesa.business.pricing.ejb._EJSRemoteStatelessPricing_a0966b04_Tie._invoke(_EJSRemoteStatelessPricing_a0966b04_Tie.java:108)
> >>        at
> >>
> >>
> com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
> >>        at
> >> com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
> >>        at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
> >>        at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
> >>        at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
> >>        at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
> >>        at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
> >>        at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
> >>        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> >> Caused by:
> >> java.lang.ClassCastException: com.adesa.data.grounding.pojo.Inventory
> >> incompatible with
> >> com.adesa.data.grounding.pojo.Inventory$$EnhancerByCGLIB$$de81aab3
> >>        at ASMAccessorImpl_11448003161226563261710.getValue(Unknown
> >> Source)
> >>        at
> >>
> >>
> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
> >>        at
> >>
> >>
> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
> >>        at
> >>
> >>
> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
> >>        at org.mvel.MVELRuntime.execute(MVELRuntime.java:90)
> >>        at
> >> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
> >>        at org.mvel.MVEL.executeExpression(MVEL.java:235)
> >>        at
> >>
> >>
> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:45)
> >>        at
> >>
> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:209)
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/ClassCastException-when-firing-rules-tp20694738p20694738.html
> >> Sent from the drools - user mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users@lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> >
> >
> > --
> >  Edson Tirelli
> >  JBoss Drools Core Development
> >  JBoss, a division of Red Hat @ www.jboss.com
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Occasional-ClassCastException-when-firing-rules-tp20694738p20705144.html
> Sent from the drools - user mailing list archive at Nabble.com.
>
> _______________________________________________
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users