Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-372

InstantiationError during condition evaluation in Drools 6.0.0.Final

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.0.0.Final
    • Fix Version/s: 6.0.1.Final
    • Component/s: None
    • Labels:
      None

      Description

      Kindly find bellow the initial discussion from rules-user@list.jboss.org
      In addition I attach a sample project that reproduce the error.
      To run it simply type 'mvn clean install exec:java'.

      An interesting thing is that on my environment the issue always appears at the 21st insertion.

      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

        Attachments

          Activity

            People

            Assignee:
            mfusco@redhat.com Mario Fusco
            Reporter:
            albertin-l Loic Albertin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: