{"record":{"id":"c071a4c5a28cc467","repo":"flowable/flowable-engine","slug":"could-not-get-body-information","errorCode":null,"errorMessage":"Could not get body information","messagePattern":"Could not get body information","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/jms/JmsMessageInboundEvent.java","lineNumber":78,"sourceCode":"            Enumeration<String> headerNames = message.getPropertyNames();\n            while (headerNames.hasMoreElements()) {\n                String headerName = headerNames.nextElement();\n                headers.put(headerName, message.getObjectProperty(headerName));\n            }\n\n            return headers;\n\n        } catch (JMSException e) {\n            throw new FlowableException(\"Could not get header information\", e);\n        }\n    }\n\n    protected String convertEventToString() {\n        if (message instanceof TextMessage) {\n            try {\n                return ((TextMessage) message).getText();\n            } catch (JMSException e) {\n                throw new FlowableException(\"Could not get body information\");\n            }\n        } else {\n            return message.toString();\n        }\n    }\n\n    @Override\n    public String toString() {\n        return \"JmsMessageInboundEvent{\" +\n                \"message=\" + message +\n                \", headers=\" + headers +\n                '}';\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-spring/src/main/java/org/flowable/eventregistry/spring/jms/JmsMessageInboundEvent.java#L60-L93","documentation":"JmsMessageInboundEvent.convertEventToString() returns the text payload for TextMessage instances. A JMSException while calling getText() is wrapped in a FlowableException with this message (note: the cause is not attached). It means the JMS provider failed while reading the message body.","triggerScenarios":"Calling getBody() on a JmsMessageInboundEvent wrapping a TextMessage whose getText() throws JMSException — typically due to a broken/closed JMS connection or an invalid message handle.","commonSituations":"Reading the body after session closure or connection failure; broker timeouts during message consumption; using messages outside their valid session context.","solutions":["Check JMS connection/session health; reprocess the event from the broker with a fresh consumer.","Ensure body extraction happens inside the message listener callback while the session is alive.","Catch FlowableException around getBody() and fall back to message.toString() or a retry path.","Investigate the JMS provider logs for the underlying connection failure."],"exampleFix":"// before\nString body = event.getBody();\n\n// after\nString body;\ntry {\n    body = event.getBody();\n} catch (FlowableException e) {\n    body = null; // schedule redelivery from the queue\n    retryQueue.offer(event);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String body = event.getBody();\n} catch (FlowableException e) {\n    // no cause attached; treat as JMS read failure and redeliver\n    retryService.scheduleRedelivery(event);\n}","preventionTips":["Extract message bodies within the listener callback while the session is open.","Never cache JMS messages across sessions or connections.","Log and monitor broker connection failures."],"tags":["jms","payload","exception-wrapping","event-registry"],"backgroundTag":"jms-read-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}