{"record":{"id":"9268f8c3e7aec1b6","repo":"apache/seatunnel","slug":"could-not-load-service-provider-for-event-handlers","errorCode":null,"errorMessage":"Could not load service provider for event handlers.","messagePattern":"Could not load service provider for event handlers\\.","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/event/EventProcessor.java","lineNumber":36,"sourceCode":"package org.apache.seatunnel.api.event;\n\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.ServiceConfigurationError;\nimport java.util.ServiceLoader;\n\npublic interface EventProcessor extends AutoCloseable {\n    void process(Event event);\n\n    static List<EventHandler> loadEventHandlers(ClassLoader classLoader) {\n        try {\n            List<EventHandler> result = new LinkedList<>();\n            ServiceLoader.load(EventHandler.class, classLoader)\n                    .iterator()\n                    .forEachRemaining(result::add);\n            return result;\n        } catch (ServiceConfigurationError e) {\n            throw new RuntimeException(\"Could not load service provider for event handlers.\", e);\n        }\n    }\n\n    static void close(List<EventHandler> handlers) throws Exception {\n        if (handlers != null) {\n            for (EventHandler handler : handlers) {\n                handler.close();\n            }\n        }\n    }\n}\n","sourceCodeStart":18,"sourceCodeEnd":48,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/event/EventProcessor.java#L18-L48","documentation":"Logged/handled in loadEventHandlers when java.util.ServiceLoader fails while discovering EventHandler SPI implementations on the given classloader — typically a malformed META-INF/services file, a class that fails static initialization, or a missing dependency of a handler class. The faulty input is the SPI metadata or handler class on the classpath, not the caller's arguments.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/event/EventProcessor.java:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the ServiceConfigurationError cause to identify the offending handler class or services file","Fix or remove the broken META-INF/services/org.apache.seatunnel.api.event.EventHandler entry","Verify the handler's dependencies are on the classloader passed to loadEventHandlers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}