apereo/cas · error · IllegalArgumentException

Expected instance of ClientFlowExecutionKey but got

Error message

Expected instance of ClientFlowExecutionKey but got 

What it means

getFlowExecution was handed a FlowExecutionKey that is not a ClientFlowExecutionKey, so the client-side repository cannot interpret it; IllegalArgumentException names the actual key class received. The input at fault is the flow execution key — it was produced by a different repository implementation or is otherwise mismatched with the configured one.

Solutions

  1. Ensure the webflow execution repository configuration is consistent (client-side repository selected on all nodes)
  2. Clear stale session/flow keys created under a previous repository configuration
  3. Check for mixed CAS node deployments using different execution repositories
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/executor/ClientFlowExecutionRepository.java:90 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08). Data as JSON: /api/errors/c13d0b9bae3c9da3. Report an issue: GitHub.

Appendix: source

Thrown at core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/executor/ClientFlowExecutionRepository.java:90

    @Override
    public FlowExecution getFlowExecution(final FlowExecutionKey key) throws FlowExecutionRepositoryException {
        if (key instanceof final ClientFlowExecutionKey clientFlowExecutionKey) {
            try {
                val encoded = clientFlowExecutionKey.getData();
                val state = (SerializedFlowExecutionState) determineTranscoder().decode(encoded);

                if (webflowProperties.getSession().isPinToSession()) {
                    verifyWebflowSessionIsCorrectlyPinned(state);
                }
                val conversationScope = state.getConversationScope();
                val flow = flowDefinitionLocator.getFlowDefinition(state.getFlowId());
                return flowExecutionFactory.restoreFlowExecution(state.getExecution(), flow, key, conversationScope, this.flowDefinitionLocator);
            } catch (final Exception e) {
                throw new ClientFlowExecutionRepositoryException("Error decoding flow execution", e);
            }
        }
        throw new IllegalArgumentException("Expected instance of ClientFlowExecutionKey but got " + key.getClass().getName());
    }


    @Override
    public void putFlowExecution(final FlowExecution flowExecution) throws FlowExecutionRepositoryException {
    }

    @Override
    public void removeFlowExecution(final FlowExecution flowExecution) throws FlowExecutionRepositoryException {
    }

    @Override
    public FlowExecutionKey getKey(final FlowExecution execution) {
        try {
            if (webflowProperties.getSession().isPinToSession()) {
                recordWebflowSessionPinningInfo(execution);
            }
            val state = new SerializedFlowExecutionState(execution);

View on GitHub (pinned to e7288fc434)