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

NullPointerException using deserialized KieBase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.45.0.Final, 7.66.0.Final
    • core engine
    • None
    • 2022 Week 08-10 (from Feb 21)
    • Hide

      Execute twice "mvn test" on the attached project: the 1st time it works, the 2nd time it fails because it uses the serialized KieBase generated during the first run (it is in the "target" folder).

      Show
      Execute twice " mvn test " on the attached project: the 1st time it works, the 2nd time it fails because it uses the serialized KieBase generated during the first run (it is in the "target" folder).
    • NEW
    • NEW

      To speed-up the startup of my drools-based application, I precompile rules during the build and serialize the resulting KieBase; then, at startup, I simply deserialize this ready-made KieBase.  This trick works fine up to version 7.44.0.Final but I get a NPE in org.drools.core.rule.EvalCondition.createContext() with more recent versions (not always: it depends on given rules).  Of course I have no exception if I execute the same rules with a "fresh" KieBase.

      I attach here a minimal test that reproduces the issue (an excerpt from my application source code)

              mfusco@redhat.com Mario Fusco
              pino.navato Pino Navato (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: