flowable/flowable-engine · error · FlowableIllegalArgumentException

Listener cannot be null.

Error message

Listener cannot be null.

What it means

Null-argument guard in FlowableEventSupport.addEventListener: an attempt was made to register a null event listener (globally or for specific types), which the engine refuses because dispatching to it would NPE.

Solutions

  1. Pass a non-null FlowableEventListener instance
  2. Check listener construction/injection (e.g. Spring bean not created) before registering
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/event/FlowableEventSupport.java:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

 * Class that allows adding and removing event listeners and dispatching events to the appropriate listeners.
 * 
 * @author Frederik Heremans
 */
public class FlowableEventSupport {

    private static final Logger LOGGER = LoggerFactory.getLogger(FlowableEventSupport.class);

    protected List<FlowableEventListener> eventListeners;
    protected Map<FlowableEventType, List<FlowableEventListener>> typedListeners;

    public FlowableEventSupport() {
        eventListeners = new CopyOnWriteArrayList<>();
        typedListeners = new HashMap<>();
    }

    public synchronized void addEventListener(FlowableEventListener listenerToAdd) {
        if (listenerToAdd == null) {
            throw new FlowableIllegalArgumentException("Listener cannot be null.");
        }
        Collection<? extends FlowableEventType> types = listenerToAdd.getTypes();
        if (types.isEmpty()) {
            if (!eventListeners.contains(listenerToAdd)) {
                eventListeners.add(listenerToAdd);
            }
        } else {
            for (FlowableEventType type : types) {
                addTypedEventListener(listenerToAdd, type);
            }
        }
    }

    public synchronized void addEventListener(FlowableEventListener listenerToAdd, FlowableEventType... types) {
        if (listenerToAdd == null) {
            throw new FlowableIllegalArgumentException("Listener cannot be null.");
        }

View on GitHub (pinned to d6d39ce1c6)