{"record":{"id":"e8505be6fd88d72f","repo":"flowable/flowable-engine","slug":"error-sending-notification","errorCode":null,"errorMessage":"Error sending notification","messagePattern":"Error sending notification","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-jmx/src/main/java/org/flowable/management/jmx/NotificationSenderAdapter.java","lineNumber":36,"sourceCode":"import org.flowable.common.engine.api.FlowableException;\r\n\r\n/**\r\n * @author Saeid Mirzaei\r\n */\r\npublic final class NotificationSenderAdapter implements NotificationSender {\r\n\r\n    protected ModelMBeanNotificationBroadcaster broadcaster;\r\n\r\n    public NotificationSenderAdapter(ModelMBeanNotificationBroadcaster broadcaster) {\r\n        this.broadcaster = broadcaster;\r\n    }\r\n\r\n    @Override\r\n    public void sendNotification(Notification notification) {\r\n        try {\r\n            broadcaster.sendNotification(notification);\r\n        } catch (Exception e) {\r\n            throw new FlowableException(\"Error sending notification\", e);\r\n        }\r\n    }\r\n}","sourceCodeStart":18,"sourceCodeEnd":39,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-jmx/src/main/java/org/flowable/management/jmx/NotificationSenderAdapter.java#L18-L39","documentation":"NotificationSenderAdapter.sendNotification() delegates to the RequiredModelMBean broadcaster. Any exception raised by the broadcaster is wrapped in a FlowableException with the message \"Error sending notification\", with the original exception as the cause.","triggerScenarios":"broadcaster.sendNotification(notification) throwing — e.g. the MBean has no registered NotificationListeners or the underlying ModelMBean notification infrastructure is in an invalid state; an unchecked exception thrown inside broadcaster processing.","commonSituations":"Managed objects sending JMX notifications before the MBean is fully registered; listeners disconnections mid-flight; runtime exceptions in notification serialization; testing JMX notification flow outside a live MBeanServer.","solutions":["Read the cause chain to find the broadcaster's underlying failure","Ensure the MBean is fully registered with the MBeanServer before notifications are sent","Register notification listeners before triggering the code path that sends notifications","Catch FlowableException around notification-sending code and degrade gracefully"],"exampleFix":"// before\nsender.sendNotification(notif); // may throw FlowableException\n// after\ntry {\n    sender.sendNotification(notif);\n} catch (FlowableException e) {\n    log.warn(\"JMX notification failed\", e.getCause());\n}","handlingStrategy":"try-catch","validationCode":"// ensure the MBean is registered and listeners attached before sending\nif (mbeanServer.isRegistered(name) && listenerCount > 0) {\n    sender.sendNotification(notif);\n}","typeGuard":null,"tryCatchPattern":"try {\n    sender.sendNotification(notif);\n} catch (FlowableException e) {\n    log.warn(\"Notification delivery failed\", e.getCause());\n    // retry or fall back to logging\n}","preventionTips":["Register the MBean and its listeners before sending notifications","Always inspect getCause() for the broadcaster's real failure","Handle notification failures defensively — they should not break business flow","Test JMX notification paths in a live MBeanServer environment"],"tags":["jmx","notification","flowable","mbean"],"backgroundTag":"api-request-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"}