{"record":{"id":"43106912b815817e","repo":"apache/seatunnel","slug":"could-not-find-any-factories-that-implement-s-i-431069","errorCode":null,"errorMessage":"Could not find any factories that implement '%s' in the classpath.","messagePattern":"Could not find any factories that implement '(.+?)' in the classpath\\.","errorType":"exception","errorClass":"SeaTunnelEngineException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/utils/FactoryUtil.java","lineNumber":70,"sourceCode":"                                                    .equals(factoryIdentifier);\n                                        } catch (IllegalAccessException\n                                                | InvocationTargetException\n                                                | NoSuchMethodException e) {\n                                            throw new SeaTunnelEngineException(\n                                                    \"Failed to call factoryIdentifier method.\");\n                                        }\n                                    })\n                            .collect(Collectors.toList());\n\n            if (foundFactories.isEmpty()) {\n                throw new SeaTunnelEngineException(\n                        String.format(\n                                \"Could not find any factories that implement '%s' in the classpath.\",\n                                factoryClass.getName()));\n            }\n\n            if (foundFactories.size() > 1) {\n                throw new SeaTunnelEngineException(\n                        String.format(\n                                \"Multiple factories for identifier '%s' that implement '%s' found in the classpath.\\n\\n\"\n                                        + \"Ambiguous factory classes are:\\n\\n\"\n                                        + \"%s\",\n                                factoryIdentifier,\n                                factoryClass.getName(),\n                                foundFactories.stream()\n                                        .map(f -> f.getClass().getName())\n                                        .sorted()\n                                        .collect(Collectors.joining(\"\\n\"))));\n            }\n\n            return foundFactories.get(0);\n        } catch (ServiceConfigurationError e) {\n            log.error(\"Could not load service provider for factories.\", e);\n            throw new SeaTunnelEngineException(\"Could not load service provider for factories.\", e);\n        }\n    }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/utils/FactoryUtil.java#L52-L88","documentation":"Thrown by FactoryUtil.discoverFactory when more than one SPI-registered factory implements the requested factoryClass with the same factoryIdentifier, making the lookup ambiguous. SeaTunnel refuses to guess and reports all conflicting factory class names in the message.","triggerScenarios":"Calling discoverFactory when two or more jars on the classpath register different factory classes returning the same factoryIdentifier (duplicate plugin versions, e.g. connector-jdbc 2.3.x and 2.3.y both installed).","commonSituations":"Upgrading a connector by adding the new jar without removing the old one; fat/uber jars embedding another connector's factory; a custom connector shadowing a built-in identifier.","solutions":["Remove the duplicate connector jar from the connectors directory so only one version providing that identifier remains.","Use --create-param-files / reinstall via install-plugin.sh after wiping stale plugin jars.","Rename your custom factory's factoryIdentifier if it conflicts with a built-in connector.","List the ambiguous classes printed in the exception message and delete/relocate one of them from the classpath."],"exampleFix":"# before\nls connectors/\n# connector-jdbc-2.3.3.jar  connector-jdbc-2.3.8.jar\n# after\nrm connectors/connector-jdbc-2.3.3.jar","handlingStrategy":"validation","validationCode":"// before submit: detect duplicate versions\nMap<String,List<File>> byName = Files.list(Paths.get(\"connectors\"))\n    .collect(Collectors.groupingBy(f -> f.getFileName().toString().replaceAll(\"-\\\\d.*\",\"\")));\nbyName.forEach((k,v) -> { if (v.size() > 1) throw new IllegalStateException(\"duplicate connector: \" + k + \" \" + v); });","typeGuard":null,"tryCatchPattern":"try { FactoryUtil.discoverFactory(f, cl, id); } catch (SeaTunnelEngineException e) { log.error(\"ambiguous factory, clean duplicate jars: {}\", e.getMessage()); throw e; }","preventionTips":["Never keep two versions of the same connector jar in connectors/.","Prefer uninstall-then-install over copying a new jar on top.","Avoid fat jars that embed other connectors' factories."],"tags":["spi","classpath","duplicate-plugin","zeta-engine"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}