flowable/flowable-engine · error · PvmException

couldn't execute event listener :

Error message

couldn't execute event listener : 

What it means

PvmException wrapping an unexpected checked Exception thrown by an ExecutionListener's notify() during an atomic operation. RuntimeExceptions are rethrown unchanged; only checked (non-runtime) exceptions from listener code get wrapped. The message concatenates the cause's message, so the root reason comes from the listener implementation.

Solutions

  1. Fix or wrap the exception inside the listener: catch checked exceptions in notify() and either handle them or rethrow as a RuntimeException.
  2. Inspect the wrapped cause (e.getCause()) / message to find the actual listener failure.
  3. Ensure listeners only throw RuntimeExceptions, per the ActivitiExecutionListener contract.

Example fix

// before
public void notify(DelegateExecution e) throws IOException {
  Files.write(path, data); // checked exception escapes
}
// after
public void notify(DelegateExecution e) {
  try {
    Files.write(path, data);
  } catch (IOException ioe) {
    throw new RuntimeException("listener failed writing output", ioe);
  }
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  processEngine.getRuntimeService().signal(executionId, vars);
} catch (PvmException e) {
  if (e.getMessage() != null && e.getMessage().startsWith("couldn't execute event listener")) {
    Throwable cause = e.getCause(); // the listener's original checked exception
    log.error("Execution listener failed: " + cause.getMessage(), cause);
  } else {
    throw e;
  }
}

Prevention

When it happens

Trigger: An ExecutionListener attached to an activity/transition/process-scope event throws a checked Exception during execution of the event atomic operation.

Common situations: Listener code doing I/O (file, network, reflection) that declares checked exceptions, e.g. a listener reading a script file or calling a legacy API.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/pvm/runtime/AbstractEventAtomicOperation.java:47

        return false;
    }

    @Override
    public void execute(InterpretableExecution execution) {
        ScopeImpl scope = getScope(execution);
        List<ExecutionListener> executionListeners = scope.getExecutionListeners(getEventName());
        int executionListenerIndex = execution.getExecutionListenerIndex();

        if (executionListeners.size() > executionListenerIndex) {
            execution.setEventName(getEventName());
            execution.setEventSource(scope);
            ExecutionListener listener = executionListeners.get(executionListenerIndex);
            try {
                listener.notify(execution);
            } catch (RuntimeException e) {
                throw e;
            } catch (Exception e) {
                throw new PvmException("couldn't execute event listener : " + e.getMessage(), e);
            }
            execution.setExecutionListenerIndex(executionListenerIndex + 1);
            execution.performOperation(this);

        } else {
            execution.setExecutionListenerIndex(0);
            execution.setEventName(null);
            execution.setEventSource(null);

            eventNotificationsCompleted(execution);
        }
    }

    protected abstract ScopeImpl getScope(InterpretableExecution execution);

    protected abstract String getEventName();

    protected abstract void eventNotificationsCompleted(InterpretableExecution execution);

View on GitHub (pinned to d6d39ce1c6)