{"record":{"id":"279fdead3bb8e446","repo":"flowable/flowable-engine","slug":"unable-to-serialize-info-node-infonode-279fde","errorCode":null,"errorMessage":"Unable to serialize info node \" + infoNode","messagePattern":"Unable to serialize info node \" \\+ infoNode","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java","lineNumber":66,"sourceCode":"        if (infoNode == null) {\n            throw new ActivitiIllegalArgumentException(\"process definition info node is null\");\n        }\n\n        ProcessDefinitionInfoEntityManager definitionInfoEntityManager = commandContext.getProcessDefinitionInfoEntityManager();\n        ProcessDefinitionInfoEntity definitionInfoEntity = definitionInfoEntityManager.findProcessDefinitionInfoByProcessDefinitionId(processDefinitionId);\n        if (definitionInfoEntity == null) {\n            definitionInfoEntity = new ProcessDefinitionInfoEntity();\n            definitionInfoEntity.setProcessDefinitionId(processDefinitionId);\n            commandContext.getProcessDefinitionInfoEntityManager().insertProcessDefinitionInfo(definitionInfoEntity);\n        } else {\n            commandContext.getProcessDefinitionInfoEntityManager().updateProcessDefinitionInfo(definitionInfoEntity);\n        }\n\n        try {\n            ObjectWriter writer = commandContext.getProcessEngineConfiguration().getObjectMapper().writer();\n            commandContext.getProcessDefinitionInfoEntityManager().updateInfoJson(definitionInfoEntity.getId(), writer.writeValueAsBytes(infoNode));\n        } catch (Exception e) {\n            throw new ActivitiException(\"Unable to serialize info node \" + infoNode, e);\n        }\n\n        return null;\n    }\n\n}\n","sourceCodeStart":48,"sourceCodeEnd":73,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java#L48-L73","documentation":"SaveProcessDefinitionInfoCmd serializes the given JsonNode (infoNode) with the engine's ObjectMapper via writer.writeValueAsBytes(infoNode) and persists it. If any exception occurs during serialization (invalid node, mapper failure) the command wraps it in an ActivitiException with this message, preserving the cause.","triggerScenarios":"Calling ProcessEngine.getProcessEngineConfiguration()/ManagementService-style API that executes SaveProcessDefinitionInfoCmd with an infoNode that Jackson cannot serialize, e.g. a JsonNode whose writeValueAsBytes throws (rare, but possible with a broken/oversized tree or misconfigured ObjectMapper).","commonSituations":"Custom ObjectMapper configured with unsupported features (e.g. failing modules), an infoNode built from invalid input, or a serialization timeout/failure on a very large process definition info JSON.","solutions":["Inspect the wrapped cause exception (getCause()) to find the actual Jackson serialization failure.","Validate the infoNode can be serialized in your code: new ObjectMapper().writeValueAsString(infoNode) before calling the command.","Check the engine's ObjectMapper configuration for faulty registered modules or serialization features."],"exampleFix":"// before\nmanagementService.executeCommand(new SaveProcessDefinitionInfoCmd(processDefinitionId, infoNode));\n// after\ntry {\n    objectMapper.writeValueAsString(infoNode); // fail fast, with a clearer error\n    managementService.executeCommand(new SaveProcessDefinitionInfoCmd(processDefinitionId, infoNode));\n} catch (JsonProcessingException e) {\n    throw new IllegalArgumentException(\"Invalid info node JSON: \" + e.getMessage(), e);\n}","handlingStrategy":"validation","validationCode":"if (infoNode == null || infoNode.isMissingNode()) throw new IllegalArgumentException(\"infoNode required\");\ntry { objectMapper.writeValueAsString(infoNode); } catch (JsonProcessingException e) { /* fail fast with clear error */ }","typeGuard":null,"tryCatchPattern":"try { managementService.executeCommand(new SaveProcessDefinitionInfoCmd(pdId, infoNode)); }\ncatch (ActivitiException e) { log.error(\"info node serialization failed\", e.getCause()); }","preventionTips":["Pre-serialize the node locally to fail fast","Keep the engine ObjectMapper configuration simple and tested","Log the cause, not just the ActivitiException wrapper"],"tags":["jackson","json","serialization","process-definition"],"backgroundTag":"json-serialization-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}