{"record":{"id":"c871287a91a5fb51","repo":"flowable/flowable-engine","slug":"cannot-create-an-event-throwing-event-listener-un-c87128","errorCode":null,"errorMessage":"Cannot create an event-throwing event-listener, unknown implementation type: ${eventListener.getImplementationType()}","messagePattern":"Cannot create an event-throwing event-listener, unknown implementation type: (.+?)","errorType":"exception","errorClass":"ActivitiIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/factory/DefaultListenerFactory.java","lineNumber":129,"sourceCode":"        BaseDelegateEventListener result = null;\n        if (ImplementationType.IMPLEMENTATION_TYPE_THROW_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {\n            result = new SignalThrowingEventListener();\n            ((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());\n            ((SignalThrowingEventListener) result).setProcessInstanceScope(true);\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_GLOBAL_SIGNAL_EVENT.equals(eventListener.getImplementationType())) {\n            result = new SignalThrowingEventListener();\n            ((SignalThrowingEventListener) result).setSignalName(eventListener.getImplementation());\n            ((SignalThrowingEventListener) result).setProcessInstanceScope(false);\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_MESSAGE_EVENT.equals(eventListener.getImplementationType())) {\n            result = new MessageThrowingEventListener();\n            ((MessageThrowingEventListener) result).setMessageName(eventListener.getImplementation());\n        } else if (ImplementationType.IMPLEMENTATION_TYPE_THROW_ERROR_EVENT.equals(eventListener.getImplementationType())) {\n            result = new ErrorThrowingEventListener();\n            ((ErrorThrowingEventListener) result).setErrorCode(eventListener.getImplementation());\n        }\n\n        if (result == null) {\n            throw new ActivitiIllegalArgumentException(\"Cannot create an event-throwing event-listener, unknown implementation type: \"\n                    + eventListener.getImplementationType());\n        }\n\n        result.setEntityClass(getEntityType(eventListener.getEntityType()));\n        return result;\n    }\n\n    /**\n     * @param entityType the name of the entity\n     * @return\n     * @throws ActivitiIllegalArgumentException when the given entity name\n     */\n    protected Class<?> getEntityType(String entityType) {\n        if (entityType != null) {\n            Class<?> entityClass = ENTITY_MAPPING.get(entityType.trim());\n            if (entityClass == null) {\n                throw new ActivitiIllegalArgumentException(\"Unsupported entity-type for an ActivitiEventListener: \" + entityType);\n            }","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/parser/factory/DefaultListenerFactory.java#L111-L147","documentation":"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.","triggerScenarios":"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).","commonSituations":"Mixing up event-listener vs event-throwing-listener configuration; typos in implementationType attribute; copying listener XML patterns between engine versions with different supported types.","solutions":["Use the supported implementationType values for throwing listeners (errorEventThrowing, messageEventThrowing, signalEventThrowing) in the activiti:eventListener element","Move the listener definition to the correct element type (eventListener vs throwing event listener) matching your intent","Verify against the engine version's schema (activiti-bpmn-extensions XSD) which types are valid"],"exampleFix":"<!-- before -->\n<activiti:eventListener events=\"JOB_EXECUTION_FAILURE\" implementationType=\"unknownType\" />\n<!-- after -->\n<activiti:eventListener events=\"JOB_EXECUTION_FAILURE\" implementationType=\"errorEventThrowing\" errorCode=\"MY_ERROR\" />","handlingStrategy":"validation","validationCode":"// check allowed implementation types for throwing listeners before deploy\njava.util.Set<String> allowed = new java.util.HashSet<>(\n  java.util.Arrays.asList(\"class\",\"expression\",\"delegateExpression\",\"errorEventThrowing\",\"messageEventThrowing\",\"signalEventThrowing\"));\nif (!allowed.contains(implementationType)) {\n  throw new IllegalStateException(\"Unsupported eventListener implementationType: \" + implementationType);\n}","typeGuard":"static boolean isKnownImplementationType(String t) {\n  return t != null && (t.equals(\"class\") || t.equals(\"expression\") || t.equals(\"delegateExpression\")\n    || t.equals(\"errorEventThrowing\") || t.equals(\"messageEventThrowing\") || t.equals(\"signalEventThrowing\"));\n}","tryCatchPattern":"try {\n  repositoryService.createDeployment().addClasspathResource(processXml).deploy();\n} catch (ActivitiIllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Cannot create an event-throwing event-listener\")) { /* fix implementationType */ }\n}","preventionTips":["Validate listener XML against the engine's BPMN extension XSD before deployment","Use only documented implementationType values for throwing listeners","Write an integration test that deploys every process definition in CI"],"tags":["bpmn","event-listener","configuration","xml"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}