{"record":{"id":"96fd2abdb109d237","repo":"flowable/flowable-engine","slug":"e-getmessage-96fd2a","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"XMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/BpmnXMLConverter.java","lineNumber":303,"sourceCode":"        }\n        \n        if (xif.isPropertySupported(XMLConstants.ACCESS_EXTERNAL_SCHEMA)) {\n            xif.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, \"\");\n        }\n\n        if (validateSchema) {\n            try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n                if (!enableSafeBpmnXml) {\n                    validateModel(inputStreamProvider);\n                } else {\n                    validateModel(new FlowableXMLStreamReader(xif.createXMLStreamReader(in)));\n                }\n            } catch (UnsupportedEncodingException e) {\n                throw new XMLException(\"The bpmn 2.0 xml is not properly encoded\", e);\n            } catch(XMLStreamException e){\n                throw new XMLException(\"Error while reading the BPMN 2.0 XML\", e);\n            } catch(Exception e){\n                throw new XMLException(e.getMessage(), e);\n            }\n        }\n        // The input stream is closed after schema validation\n        try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n            // XML conversion\n            return convertToBpmnModel(xif.createXMLStreamReader(in));\n        } catch (UnsupportedEncodingException e) {\n            throw new XMLException(\"The bpmn 2.0 xml is not properly encoded\", e);\n        } catch (XMLStreamException e) {\n            throw new XMLException(\"Error while reading the BPMN 2.0 XML\", e);\n        } catch (IOException e) {\n            throw new XMLException(e.getMessage(), e);\n        }\n    }\n\n    public BpmnModel convertToBpmnModel(XMLStreamReader xtr) {\n        BpmnModel model = new BpmnModel();\n        model.setStartEventFormTypes(startEventFormTypes);","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-bpmn-converter/src/main/java/org/flowable/bpmn/converter/BpmnXMLConverter.java#L285-L321","documentation":"In the same convertToBpmnModel(InputStreamProvider, String) catch-all, any non-XMLStreamException Exception during the first parse pass is rethrown as XMLException whose message is the original e.getMessage(). It is a generic wrapper so all parse failures surface as Flowable XMLException.","triggerScenarios":"Any RuntimeException (e.g. NullPointerException, IllegalArgumentException from a converter, SAX validation error wrapped differently) thrown while validateModel or createXMLStreamReader processes the first-pass stream in convertToBpmnModel(InputStreamProvider, String).","commonSituations":"XSD validation failing in validateModel with a differently-wrapped exception, custom converter extensions throwing, or JDK/stax implementation quirks when reading the deployed BPMN file.","solutions":["Inspect the cause chain (e.getCause()) — the real error text is in the wrapped exception.","Fix the underlying problem reported by the cause (invalid model element, NPE in a custom converter, etc.).","Re-run the model through the Flowable modeler or validateModel to catch issues before deploy.","Upgrade flowable-bpmn-converter if the cause indicates a known converter bug."],"exampleFix":"// before\ncatch (XMLException e) { log.error(e.getMessage()); } // message may be empty/obscure\n// after\ncatch (XMLException e) {\n    Throwable cause = e.getCause();\n    log.error(\"BPMN parse failed: {}\", cause != null ? cause.getMessage() : e.getMessage(), cause);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    converter.convertToBpmnModel(provider, encoding);\n} catch (XMLException e) {\n    // message is e.getMessage() of the wrapped cause — always log the cause chain\n    log.error(\"BPMN first-pass parse failed\", e);\n    Throwable root = e;\n    while (root.getCause() != null) root = root.getCause();\n    throw new DeploymentException(\"Root cause: \" + root.getMessage(), e);\n}","preventionTips":["Always inspect and log the full cause chain, not just the wrapper message","Test BPMN files through convertToBpmnModel in CI before production deploy","Pin converter and modeler versions together"],"tags":["java","xml","bpmn","wrapped-exception"],"backgroundTag":"json-parse-error","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"}