Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-2729

Better error message if DRL is compiled at runtime and drools-core-static is in the classpath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 0.13.0
    • None
    • None
    • 1
    • 2020 Week 28-30 (from Jul 6)

      When switching from Drools 7 to Kogito Drools 1, I got this error messages:

      16:12:08.706 [EventQueue-0] ERROR Unable to build KieBaseModel:defaultKieBase
      Unable to create Field Extractor for 'id'null : [Rule name='Horizontal conflict']
      java.lang.UnsupportedOperationException
      Field Reader does not exist for declaration '$id' in '$id : id' in the rule 'Horizontal conflict' : [Rule name='Horizontal conflict']
      
      Unable to create Field Extractor for 'row'null : [Rule name='Horizontal conflict']
      java.lang.UnsupportedOperationException
      Unable to create Field Extractor for 'rowIndex'null : [Rule name='Horizontal conflict']
      java.lang.UnsupportedOperationException
      Field Reader does not exist for declaration '$i' in '$i : rowIndex' in the rule 'Horizontal conflict' : [Rule name='Horizontal conflict']
      

      Notice the `java.lang.UnsupportedOperationException` in there. Yes, it's hard to notice and it doesn't say much, but it's the best clue as to what went wrong.
      Turns out I had drools-core-static in my classpath instead of drools-core-dynamic.

      Proposal A):
      throw new UnsupportedOperationException("The artifact drools-core-static does not support this operation, try using drools-core-dynamic instead." )

            evacchi Edoardo Vacchi (Inactive)
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: