flowable/flowable-engine · warning

Exception while executing event-listener, which was ignored

Error message

Exception while executing event-listener, which was ignored

What it means

FlowableEventSupport dispatches engine events to registered FlowableEventListener instances. If a listener throws a Throwable and its isFailOnException() returns false, the exception is deliberately swallowed and only logged as a warning, so the remaining listeners still get notified. This means an exception thrown inside your listener implementation will NOT propagate to the caller or roll back the transaction unless the listener opts in.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/event/FlowableEventSupport.java:129

    protected void dispatchEvent(FlowableEvent event, FlowableEventListener listener) {
        if (listener.isFireOnTransactionLifecycleEvent()) {
            dispatchTransactionEventListener(event, listener);
        } else {
            dispatchNormalEventListener(event, listener);
        }
    }

    protected void dispatchNormalEventListener(FlowableEvent event, FlowableEventListener listener) {
        try {
            listener.onEvent(event);
        } catch (Throwable t) {
            if (listener.isFailOnException()) {
                throw t;
            } else {
                // Ignore the exception and continue notifying remaining listeners. The listener
                // explicitly states that the exception should not bubble up
                LOGGER.warn("Exception while executing event-listener, which was ignored", t);
            }
        }
    }

    protected void dispatchTransactionEventListener(FlowableEvent event, FlowableEventListener listener) {
        TransactionContext transactionContext = Context.getTransactionContext();
        if (transactionContext == null) {
            return;
        }
        
        ExecuteEventListenerTransactionListener transactionListener = new ExecuteEventListenerTransactionListener(listener, event); 
        if (listener.getOnTransaction().equalsIgnoreCase(TransactionState.COMMITTING.name())) {
            transactionContext.addTransactionListener(TransactionState.COMMITTING, transactionListener);
            
        } else if (listener.getOnTransaction().equalsIgnoreCase(TransactionState.COMMITTED.name())) {
            transactionContext.addTransactionListener(TransactionState.COMMITTED, transactionListener);
            
        } else if (listener.getOnTransaction().equalsIgnoreCase(TransactionState.ROLLINGBACK.name())) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Inspect the WARN stack trace in logs to find the throwing listener and fix the bug in its notify() implementation
  2. If the exception must abort the operation, override isFailOnException() on your listener to return true so the Throwable is rethrown
  3. Make the listener body defensive: wrap risky work (remote calls, parsing) in its own try-catch or move it to async processing
  4. Verify the correct listener is registered for the event type via addEventListeners/addTypedEventListener; a mis-registered listener may receive events it cannot handle

Example fix

// before
public class MyListener implements FlowableEventListener {
    public void notify(FlowableEvent event) {
        process(event); // throws NPE -> swallowed with WARN
    }
}
// after
public class MyListener implements FlowableEventListener {
    public void notify(FlowableEvent event) {
        process(event);
    }
    @Override
    public boolean isFailOnException() {
        return true; // rethrow so engine/transaction sees the failure
    }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
    listener.notify(event);
} catch (Throwable t) {
    if (listener.isFailOnException()) {
        throw t;
    }
    log.warn("listener failed; event {}", event.getType(), t);
}

Prevention

When it happens

Trigger: Any FlowableEventListener whose isFailOnException() returns false (the default for most base listener implementations) throws a Throwable from notify(FlowableEvent) while dispatchEvent iterates the listener list.

Common situations: A custom global event listener hits a NullPointerException or DB error in its handler code; a listener calls a flaky external service; developers are confused why their listener bug 'disappears' and only shows up as a WARN in logs.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/f7177032144c25c6. Report an issue: GitHub.