{"record":{"id":"b8551ebfb4f535a1","repo":"apache/seatunnel","slug":"plugin-instance-s-is-not-supported","errorCode":null,"errorMessage":"Plugin instance: %s is not supported.","messagePattern":"Plugin instance: (.+?) is not supported\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-plugin-discovery/src/main/java/org/apache/seatunnel/plugin/discovery/AbstractPluginDiscovery.java","lineNumber":404,"sourceCode":"            factories =\n                    FactoryUtil.discoverFactories(Thread.currentThread().getContextClassLoader());\n        }\n        return factories;\n    }\n\n    protected T loadPluginInstance(PluginIdentifier pluginIdentifier, ClassLoader classLoader) {\n        ServiceLoader<T> serviceLoader = ServiceLoader.load(getPluginBaseClass(), classLoader);\n        for (T t : serviceLoader) {\n            if (t instanceof PluginIdentifierInterface) {\n                // new api\n                PluginIdentifierInterface pluginIdentifierInstance = (PluginIdentifierInterface) t;\n                if (StringUtils.equalsIgnoreCase(\n                        pluginIdentifierInstance.getPluginName(),\n                        pluginIdentifier.getPluginName())) {\n                    return (T) pluginIdentifierInstance;\n                }\n            } else {\n                throw new UnsupportedOperationException(\n                        \"Plugin instance: \" + t + \" is not supported.\");\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Get the plugin instance.\n     *\n     * @param pluginIdentifier plugin identifier.\n     * @return plugin instance.\n     */\n    protected Optional<List<URL>> getPluginJarPath(PluginIdentifier pluginIdentifier) {\n        return pluginJarPath.computeIfAbsent(pluginIdentifier, this::findPluginJarPath);\n    }\n\n    /**\n     * Get spark plugin interface.","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-plugin-discovery/src/main/java/org/apache/seatunnel/plugin/discovery/AbstractPluginDiscovery.java#L386-L422","documentation":"loadPluginInstance iterates candidate plugin instances and returns the one whose plugin name matches the requested PluginIdentifier. If a discovered instance's class type is not recognized/supported by the discovery logic, it throws UnsupportedOperationException naming the instance.","triggerScenarios":"loadPluginInstance (via pluginInstance/createOptionalPluginInstance) encounters an instance whose class does not match expected factory/instance shapes while matching the plugin identifier — e.g. a class in the jar implements an unexpected interface or an incompatible SeaTunnel API version.","commonSituations":"Connector jar built against a different SeaTunnel API version placed in the plugin dir; custom plugin implementing an outdated or wrong interface; shaded/duplicated plugin classes confusing type checks.","solutions":["Check that the connector jar version matches your SeaTunnel engine version and re-download from install-plugin.sh","Verify the plugin implements the correct current API interface (Source/Sink/TransformFactory with proper @Factory annotation)","Remove duplicate or stale jars for the same plugin from the connectors directory","If custom, rebuild the plugin against the SeaTunnel API module version you deploy"],"exampleFix":"// before: mixed connector versions in plugins dir\nconnectors/connector-jdbc-2.3.0.jar\nconnectors/connector-jdbc-2.3.12.jar\n// after: keep only the version matching the engine\nrm connectors/connector-jdbc-2.3.0.jar","handlingStrategy":"try-catch","validationCode":"// Verify jar versions match the engine before launch\nls $SEATUNNEL_HOME/connectors | grep -v \"connector-.*-${SEATUNNEL_VERSION}\\.jar\" && echo 'stale connector versions present'","typeGuard":null,"tryCatchPattern":"try {\n    pluginInstance(PluginIdentifier.of(...));\n} catch (UnsupportedOperationException e) {\n    LOG.error(\"Incompatible plugin jar for {}: {}\", pluginId, e.getMessage());\n    throw new SeaTunnelException(\"Reinstall matching connector jar\", e);\n}","preventionTips":["Keep connector jar versions identical to the engine version","Avoid mixing jars from different SeaTunnel releases","Rebuild custom plugins against the deployed API version","Deduplicate the connectors directory"],"tags":["java","plugin-discovery","unsupported-type","class-loading"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}