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

ClassCastException at BuildUtils.mergeNodes with two rules having identical constraints

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.27.0.Final
    • core engine
    • None

      Building a rule base where two rules have identical constraints fails with a ClassCastException:

      java.lang.ClassCastException: org.drools.core.rule.constraint.EvaluatorConstraint cannot be cast to org.drools.core.rule.constraint.MvelConstraint
      	at org.drools.core.reteoo.builder.BuildUtils.mergeNodes(BuildUtils.java:176)
      	at org.drools.core.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:152)
      	at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.buildJoinNode(GroupElementBuilder.java:143)
      	at org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:110)
      	at org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:167)
      	at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:139)
      	at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110)
      	at org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1523)
      	at org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:913)
      	at org.drools.core.impl.KnowledgeBaseImpl.lambda$addPackages$2(KnowledgeBaseImpl.java:715)
      	at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:732)
      	at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:715)
      	at org.drools.compiler.kie.builder.impl.AbstractKieModule.createKieBase(AbstractKieModule.java:215)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:406)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieBase(KieContainerImpl.java:396)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieBase(KieContainerImpl.java:391)
      	at org.kie.internal.utils.KieHelper.build(KieHelper.java:80)
      	at org.drools.compiler.integrationtests.ExpirationTest.testEventSameContraint(ExpirationTest.java:595)
      

              mfusco@redhat.com Mario Fusco
              rhn-support-mputz Martin Weiler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: