{"record":{"id":"b923c2bf8a42d6a9","repo":"flowable/flowable-engine","slug":"unsupported-event-object-type-event-geteventobj","errorCode":null,"errorMessage":"Unsupported event object type: ${event.getEventObject().getClass()}","messagePattern":"Unsupported event object type: (.+?)","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java","lineNumber":65,"sourceCode":"public abstract class BaseEventRegistryEventConsumer implements EventRegistryEventConsumer {\n\n    protected AbstractEngineConfiguration engineConfiguration;\n    protected CommandExecutor commandExecutor;\n\n    public BaseEventRegistryEventConsumer(AbstractEngineConfiguration engineConfiguration) {\n        this.engineConfiguration = engineConfiguration;\n        this.commandExecutor = engineConfiguration.getCommandExecutor();\n    }\n\n    @Override\n    public EventRegistryProcessingInfo eventReceived(EventRegistryEvent event) {\n        if (event.getEventObject() != null && event.getEventObject() instanceof EventInstance) {\n            return eventReceived((EventInstance) event.getEventObject());\n        } else {\n            if (event.getEventObject() == null) {\n                throw new FlowableIllegalArgumentException(\"No event object was passed to the consumer\");\n            } else {\n                throw new FlowableIllegalArgumentException(\"Unsupported event object type: \" + event.getEventObject().getClass());\n            }\n        }\n    }\n\n    protected abstract EventRegistryProcessingInfo eventReceived(EventInstance eventInstance);\n\n    /**\n     * Generates all possible correlation keys for the given correlation parameters.\n     * The first element in the list will only have used one parameter. The last element in the list has included all parameters.\n     */\n    protected Collection<CorrelationKey> generateCorrelationKeys(Collection<EventPayloadInstance> correlationParameterInstances) {\n\n        if (correlationParameterInstances.isEmpty()) {\n            return Collections.emptySet();\n        }\n\n        int numberOfCorrelationParameters = correlationParameterInstances.size();\n        if (numberOfCorrelationParameters == 1) {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry/src/main/java/org/flowable/eventregistry/impl/consumer/BaseEventRegistryEventConsumer.java#L47-L83","documentation":"BaseEventRegistryEventConsumer.eventReceived throws FlowableIllegalArgumentException when the event object is non-null but is not an instance of EventInstance. Only EventInstance payloads are supported by this consumer, so any other object type is rejected with the payload's class name in the message.","triggerScenarios":"Publishing an EventRegistryEvent whose event object is a raw String, Map, JSON node, or custom DTO instead of an EventInstance, e.g. from a custom channel adapter or test that skipped payload conversion.","commonSituations":"Migrating from older Flowable versions where raw payloads were accepted, custom adapters passing the deserialized JSON directly, or unit tests feeding mock objects into the consumer.","solutions":["Convert the raw payload to an EventInstance using the event registry's payload conversion (InboundEventPayloadConverter / EventRegistry.buildEventInstance) before creating the event.","If you need other types, use a different consumer that handles that payload type instead of BaseEventRegistryEventConsumer subclasses.","Log event.getEventObject().getClass() at the producer side and fix the adapter to always wrap in EventInstance."],"exampleFix":"// before\nnew EventRegistryEvent(payloadJson); // String payload\n// after\nEventInstance instance = eventRegistry.createEventInstance(eventKey, payloadJson);\nnew EventRegistryEvent(instance);","handlingStrategy":"type-guard","validationCode":"Object o = event.getEventObject();\nif (!(o instanceof EventInstance)) throw new IllegalArgumentException(\"Expected EventInstance, got \" + (o == null ? \"null\" : o.getClass()));","typeGuard":"boolean isEventInstance(EventRegistryEvent e) { return e != null && e.getEventObject() instanceof EventInstance; }","tryCatchPattern":"try { consumer.eventReceived(event); } catch (FlowableIllegalArgumentException e) { log.error(\"Unsupported payload type: {}\", e.getMessage()); }","preventionTips":["Convert raw JSON/Map payloads via the event registry payload converter before dispatch","Keep a single adapter code path that constructs EventInstance events","Cover the adapter with a test asserting instanceof EventInstance"],"tags":["flowable","event-registry","type-mismatch","consumer"],"backgroundTag":"type-mismatch","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}