flowable/flowable-engine · error · FlowableException

exception while executing command

Error message

exception while executing command 

What it means

Rethrown by CommandContext.rethrowExceptionIfNeeded during close(): the command being executed failed with an exception that is neither an optimistic-locking nor a reduce-log FlowableException; the original error is wrapped/rethrown with this prefix so it propagates out of the command context with context about which command failed.

Solutions

  1. Inspect the cause and the failing command name to locate the real error
  2. Fix the underlying failure (usually a business or mapping error), not this wrapper
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/CommandContext.java:142 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/fd2c07d6623e2781. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/CommandContext.java:142

            LOGGER.debug("Optimistic locking exception : {}", exception.getMessage(), exception);
            
        } else if (exception instanceof FlowableException && ((FlowableException) exception).isReduceLogLevel()) {
            // reduce log level, because this may have been caused because of job deletion due to cancelActiviti="true"
            LOGGER.info("Error while closing command context", exception);
            
        } else {
            LOGGER.error("Error while closing command context", exception);
            
        }
    }

    protected void rethrowExceptionIfNeeded() throws Error {
        if (exception instanceof Error) {
            throw (Error) exception;
        } else if (exception instanceof RuntimeException) {
            throw (RuntimeException) exception;
        } else {
            throw new FlowableException("exception while executing command " + command, exception);
        }
    }

    public void addCloseListener(CommandContextCloseListener commandContextCloseListener) {
        if (closeListeners == null) {
            closeListeners = new ArrayList<>();
        }
        
        if (!commandContextCloseListener.multipleAllowed()) {
            for (CommandContextCloseListener closeListenerItem : closeListeners) {
    			if (closeListenerItem.getClass().equals(commandContextCloseListener.getClass())) {
    				return;
    			}
    		}
        }
        
        closeListeners.add(commandContextCloseListener);
        

View on GitHub (pinned to d6d39ce1c6)