flowable/flowable-engine · error · ActivitiIllegalArgumentException

Cannot create an event-throwing event-listener, unknown…

Error message

Cannot create an event-throwing event-listener, unknown implementation type: ${eventListener.getImplementationType()}

What it means

DefaultListenerFactory.createEventThrowingEventListener builds listeners that throw BPMN errors/signals/messages on events. Only certain implementation types (e.g. error-throwing variants: class, expression, delegateExpression mapped to error throw behavior) are supported; an unknown implementationType yields a null result and this ActivitiIllegalArgumentException.

Solutions

  1. Use the supported implementationType values for throwing listeners (errorEventThrowing, messageEventThrowing, signalEventThrowing) in the activiti:eventListener element
  2. Move the listener definition to the correct element type (eventListener vs throwing event listener) matching your intent
  3. Verify against the engine version's schema (activiti-bpmn-extensions XSD) which types are valid

Example fix

<!-- before -->
<activiti:eventListener events="JOB_EXECUTION_FAILURE" implementationType="unknownType" />
<!-- after -->
<activiti:eventListener events="JOB_EXECUTION_FAILURE" implementationType="errorEventThrowing" errorCode="MY_ERROR" />
Defensive patterns

Strategy: validation

Validate before calling

// check allowed implementation types for throwing listeners before deploy
java.util.Set<String> allowed = new java.util.HashSet<>(
  java.util.Arrays.asList("class","expression","delegateExpression","errorEventThrowing","messageEventThrowing","signalEventThrowing"));
if (!allowed.contains(implementationType)) {
  throw new IllegalStateException("Unsupported eventListener implementationType: " + implementationType);
}

Type guard

static boolean isKnownImplementationType(String t) {
  return t != null && (t.equals("class") || t.equals("expression") || t.equals("delegateExpression")
    || t.equals("errorEventThrowing") || t.equals("messageEventThrowing") || t.equals("signalEventThrowing"));
}

Try / catch

try {
  repositoryService.createDeployment().addClasspathResource(processXml).deploy();
} catch (ActivitiIllegalArgumentException e) {
  if (e.getMessage().startsWith("Cannot create an event-throwing event-listener")) { /* fix implementationType */ }
}

Prevention

When it happens

Trigger: An event listener definition in BPMN XML (extension element activiti:eventListener) uses events="..." with an implementationType the factory doesn't recognize when creating an event-throwing listener (e.g. a type valid only for non-throwing listeners).

Common situations: Mixing up event-listener vs event-throwing-listener configuration; typos in implementationType attribute; copying listener XML patterns between engine versions with different supported types.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/factory/DefaultListenerFactory.java:129

        BaseDelegateEventListener result = null;
        if (ImplementationType.IMPLEMENTATION_TYPE_THROW_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {
            result = new SignalThrowingEventListener();
            ((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());
            ((SignalThrowingEventListener) result).setProcessInstanceScope(true);
        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_GLOBAL_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {
            result = new SignalThrowingEventListener();
            ((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());
            ((SignalThrowingEventListener) result).setProcessInstanceScope(false);
        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_MESSAGE_EVENT.equals(eventListener.getImplementationType())) {
            result = new MessageThrowingEventListener();
            ((MessageThrowingEventListener) result).setMessageName(eventListener.getImplementation());
        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_ERROR_EVENT.equals(eventListener.getImplementationType())) {
            result = new ErrorThrowingEventListener();
            ((ErrorThrowingEventListener) result).setErrorCode(eventListener.getImplementation());
        }

        if (result == null) {
            throw new ActivitiIllegalArgumentException("Cannot create an event-throwing event-listener, unknown implementation type: "
                    + eventListener.getImplementationType());
        }

        result.setEntityClass(getEntityType(eventListener.getEntityType()));
        return result;
    }

    /**
     * @param entityType the name of the entity
     * @return
     * @throws ActivitiIllegalArgumentException when the given entity name
     */
    protected Class<?> getEntityType(String entityType) {
        if (entityType != null) {
            Class<?> entityClass = ENTITY_MAPPING.get(entityType.trim());
            if (entityClass == null) {
                throw new ActivitiIllegalArgumentException("Unsupported entity-type for an ActivitiEventListener: " + entityType);
            }

View on GitHub (pinned to d6d39ce1c6)