Skip to content

[BUG] Jackson UDSerde error #2922

@yangyichao-mango

Description

@yangyichao-mango

Describe the bug

There is a Serde Exception in TaskNode, because we use Jackson UDSerde JSONUtils.JsonDataSerializer and JSONUtils.JsonDataDeserializer in TaskNode fields.

The UDSerde can convert "[]" to ""[]"" because the JsonDataDeserializer node.toString() implement.

To Reproduce
Steps to reproduce the behavior, for example:

public static void main(String[] args) { String a = "{\"conditionResult\":\"{\\\"successNode\\\":[\\\"\\\"],\\\"failedNode\\\":[\\\"\\\"]}\"," + "\"conditionsTask\":false,\"depList\":[],\"dependence\":\"{}\",\"forbidden\":false," + "\"id\":\"tasks-86823\",\"maxRetryTimes\":1,\"name\":\"shell test\"," + "\"params\":\"{\\\"resourceList\\\":[],\\\"localParams\\\":[],\\\"rawScript\\\":\\\"echo " + "'yyc'\\\"}\",\"preTasks\":\"[]\",\"retryInterval\":1,\"runFlag\":\"NORMAL\"," + "\"taskInstancePriority\":\"HIGHEST\",\"taskTimeoutParameter\":{\"enable\":false,\"interval\":0}," + "\"timeout\":\"{}\",\"type\":\"SHELL\",\"workerGroup\":\"default\"}"; TaskNode taskNode = JSONUtils.parseObject(a, TaskNode.class); }

Expected behavior
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.util.ArrayList out of VALUE_STRING token at [Source: (String)""[]""; line: 1, column: 1]

Screenshots
image

Which version of Dolphin Scheduler:
-[dev]

**Requirement or improvement

  • We can remove the UDSerde JSONUtils.JsonDataSerializer and JSONUtils.JsonDataDeserializer in JSONUtils.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions