Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3523

java.lang.ClassCastException: org.drools.facttemplates.FactTemplateObjectType cannot be cast to org.drools.base.ClassObjectType

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.4.1.Final, 5.5.0.Beta1
    • None
    • None
    • None
    • High

      I have analyzed the issue and found that the issue is happening at the initDeclaredMask method of BetaNode.java of drools-core-5.4.0.final.jar at the following lines of code:

      ObjectType objectType = pattern.getObjectType();

      if ( !(objectType instanceof ClassObjectType) )

      { // InitialFact has no type declaration and cannot be property specific // Only ClassObjectType can use property specific rightDeclaredMask = Long.MAX_VALUE; }

      Class objectClass = ((ClassObjectType) objectType).getClassType();
      The above code will throw ClassCastException as irrespective of the objectType is instance of ClassObjectType or not, trying to type cast to ClassObjectType.

              mfusco@redhat.com Mario Fusco
              viswa.repalle Viswa Repalle (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

                Created:
                Updated:
                Resolved:
                Archived: