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

NPE because ConsequenceMetaData.toString is not null-safe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 6.1.0.Final
    • None
    • None
    • Hide

      define a block of Spring configuration that looks like the following

        <kie:kmodule id="KB1">
          <kie:kbase name="sampleBase" packages="com.example.br">
            <kie:ksession name="sample-session"/>
          </kie:kbase>
        </kie:kmodule>
      

      set the system property sun.io.serialization.extendedDebugInfo to true

      Show
      define a block of Spring configuration that looks like the following <kie:kmodule id= "KB1" > <kie:kbase name= "sampleBase" packages= "com.example.br" > <kie:ksession name= "sample-session" /> </kie:kbase> </kie:kmodule> set the system property sun.io.serialization.extendedDebugInfo to true

      The toString() method in org.drools.core.rule.ConsequenceMetaData is not null-safe. It assumes that the List statements contains at least one element.

      This is a problem when the method gets invoked during the serialization-based deep clone effected during initialization under certain conditions (see the "Reproduce" section).

      With this combination, code in java.io.ObjectOutputStream ends up invoking the toString() method in order to print additional information in the stack trace for java.io.NotSerializableException. I have attached a snippet of the stack trace as a reference.

      The code in question is unchanged even in the latest version in github.

            mfusco@redhat.com Mario Fusco
            smoothreggae george thomas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: