flowable/flowable-engine · error · ActivitiException

SystemException while getting transaction

Error message

SystemException while getting transaction 

What it means

JtaTransactionContext.getTransaction() delegates to the configured TransactionManager.getTransaction(). A javax.transaction.SystemException from the manager (failed to determine current transaction) is wrapped in this ActivitiException. It means the engine could not obtain the current JTA transaction at all.

Solutions

  1. Inspect the wrapped SystemException cause for the transaction manager's root failure.
  2. Verify the configured TransactionManager matches your runtime (container JNDI lookup vs standalone JTA like JBossSTM / Atomikos).
  3. Ensure the engine is configured with JtaProcessEngineConfiguration (or correct Spring/Tomcat JTA config) so a valid TransactionManager is set.
  4. Check that the transaction service is up and that no earlier transaction failure left the manager unusable.

Example fix

// before
ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
// after (JTA environment)
JtaProcessEngineConfiguration cfg = new JtaProcessEngineConfiguration();
cfg.setTransactionManager(transactionManager);
Defensive patterns

Strategy: validation

Validate before calling

if (transactionManager == null) throw new IllegalStateException("JTA TransactionManager not configured");

Try / catch

try { engineCommand(); } catch (ActivitiException e) { if (e.getCause() instanceof SystemException && e.getMessage().contains("getting transaction")) { failFast("engine cannot resolve current JTA transaction"); } else { throw e; } }

Prevention

When it happens

Trigger: Any code path that resolves the current transaction — rollback(), addTransactionListener(), or transaction() (the TransactionContext factory method) — when TransactionManager.getTransaction() throws SystemException.

Common situations: Wrong TransactionManager implementation injected into the JTA configuration (e.g. standalone manager in a container), transaction service not started, or engine commands executed outside a supported JTA environment.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cfg/jta/JtaTransactionContext.java:66

        // managed transaction, mark rollback-only if not done so already.
        try {
            Transaction transaction = getTransaction();
            int status = transaction.getStatus();
            if (status != Status.STATUS_NO_TRANSACTION && status != Status.STATUS_ROLLEDBACK) {
                transaction.setRollbackOnly();
            }
        } catch (IllegalStateException e) {
            throw new ActivitiException("Unexpected IllegalStateException while marking transaction rollback only", e);
        } catch (SystemException e) {
            throw new ActivitiException("SystemException while marking transaction rollback only", e);
        }
    }

    protected Transaction getTransaction() {
        try {
            return transactionManager.getTransaction();
        } catch (SystemException e) {
            throw new ActivitiException("SystemException while getting transaction ", e);
        }
    }

    @Override
    public void addTransactionListener(TransactionState transactionState, final TransactionListener transactionListener) {
        Transaction transaction = getTransaction();
        CommandContext commandContext = Context.getCommandContext();
        try {
            transaction.registerSynchronization(new TransactionStateSynchronization(transactionState, transactionListener, commandContext));
        } catch (IllegalStateException e) {
            throw new ActivitiException("IllegalStateException while registering synchronization ", e);
        } catch (RollbackException e) {
            throw new ActivitiException("RollbackException while registering synchronization ", e);
        } catch (SystemException e) {
            throw new ActivitiException("SystemException while registering synchronization ", e);
        }
    }

View on GitHub (pinned to d6d39ce1c6)