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

Handle the case where a class is not found in JSONMarshaller$CustomObjectDeserializer

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 7.65.0.Final
    • 7.64.0.Final
    • kie server
    • None
    • 2022 Week 02-04 (from Jan 10)
    • 2
    • NEW
    • NEW

    Description

      With a payload like this,

      {
        "lookup" : "StatelessKieSession",
          "commands" : [ {
            "insert" : {
              "object" : {"com.nonexisting.Person":{"name":"taro","age":"20"}},
              "out-identifier" : "person",
              "return-object" : "true",
              "entry-point" : "DEFAULT"
             }
          }, {
              "fire-all-rules" : { }
         } ]
      }
      

      if JSONMarshaller cannot find a class "com.nonexisting.Person" from classloader, it deserializes the object as a LinkedHashMap with a key "com.nonexisting.Person". It may just result in no matching rule.

      https://github.com/kiegroup/droolsjbpm-integration/blob/7.52.0.Final/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/json/JSONMarshaller.java#L807-L808

      However, users may want a warning or an Exception. This JIRA is to add a system property switch to choose the behaviour.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: