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

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

XMLWordPrintable

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

      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.

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

                Created:
                Updated:
                Resolved: