[rules-users] InstantiationError during condition evaluation in Drools 6.0.0.Final

Loïc Albertin loic.albertin at bull.net
Mon Dec 9 08:33:47 EST 2013


Hi all,

I'm migrating from an old Drools 5.1 version to 6.0.0.Final. Sometimes 
(I don't really get under which conditions as sometimes it works), I'm 
facing an InstantiationError exception when I insert a fact into a 
stateful kie session. This exception is thrown by a generated class 
named ConditionEvaluator<UUID> which doesn't help for debugging! ;)

The inserted object is a basic POJO (named JasmineEventEB) except for an 
attribute named "value" which accept any "Serializable" object and which 
is causing the issue.

The rule condition is quite simple
$e : JasmineEventEB(probe == "Button:pris" && value == "1")

In debugging I found that it failed when evaluating the value == "1" 
part. I can also confirm that the value for the actually inserted 
JasmineEventEB is a string.

The stacktrace is:

java.lang.InstantiationError: java.io.Serializable
         at 
ConditionEvaluatorae1a73837e8146bda23004a0450e2e52.evaluate(Unknown Source)
         at 
org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:212)
         at 
org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:169)
         at 
org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
         at 
org.drools.core.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:502)
         at 
org.drools.core.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:387)
         at 
org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:138)
         at 
org.drools.core.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:502)
         at 
org.drools.core.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:377)
         at 
org.drools.core.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:288)
         at 
org.drools.core.reteoo.EntryPointNode.assertObject(EntryPointNode.java:260)
         at 
org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:360)
         at 
org.drools.core.common.NamedEntryPoint.insert(NamedEntryPoint.java:279)
         at 
org.drools.core.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1149)
         at 
org.drools.core.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1093)
         at 
org.drools.core.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:308)


I tested both with the java and mvel dialect with the same result.
Does someone has already encountered this kind of error?

If you need more details or clarifications please let me know.

Thanks & regards,
Loïc



More information about the rules-users mailing list