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

ClassCastException using collect accumulator

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 6.2.0.Final
    • None
    • None

    Description

      When a collect accumulator is in a subnetwork the left tuple is unwrapped twice causing a ClassCastException like the following:

      java.lang.RuntimeException: java.lang.ClassCastException: ExpectedMessage cannot be cast to org.drools.core.reteoo.LeftTuple
      at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:90)
      at org.drools.core.phreak.PhreakAccumulateNode.reaccumulateForLeftTuple(PhreakAccumulateNode.java:833)
      at org.drools.core.phreak.PhreakAccumulateNode.doLeftUpdatesProcessChildren(PhreakAccumulateNode.java:401)
      at org.drools.core.phreak.PhreakAccumulateNode.doLeftUpdates(PhreakAccumulateNode.java:301)
      at org.drools.core.phreak.PhreakAccumulateNode.doNode(PhreakAccumulateNode.java:72)
      at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:562)
      at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:533)
      at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:334)
      at org.drools.core.phreak.RuleNetworkEvaluator.evalStackEntry(RuleNetworkEvaluator.java:224)
      at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:166)
      at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116)
      at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:231)
      at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:106)
      at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1008)
      at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1294)
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1289)
      at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1262)
      at org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:109)
      at org.drools.core.command.runtime.rule.FireAllRulesCommand.execute(FireAllRulesCommand.java:34)
      at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:155)
      at org.drools.core.command.runtime.BatchExecutionCommandImpl.execute(BatchExecutionCommandImpl.java:76)
      at org.drools.core.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:321)

      Caused by: java.lang.ClassCastException: ExpectedMessage cannot be cast to org.drools.core.reteoo.LeftTuple
      at org.drools.core.base.accumulators.CollectAccumulator.accumulate(CollectAccumulator.java:95)
      at org.drools.core.rule.SingleAccumulate.accumulate(SingleAccumulate.java:82)
      ... 50 more

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mfusco@redhat.com Mario Fusco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: