apache/shardingsphere · error · PluginNotFoundException

10

10

Error message

Can not find plugin class '%s'.

What it means

Error "Can not find plugin class '%s'." thrown in apache/shardingsphere.

Source

Thrown at infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/executor/ral/plugin/ShowPluginsExecutor.java:66

        return DatabaseSupportedTypedSPI.class.isAssignableFrom(pluginClass)
                ? Arrays.asList("type", "type_aliases", "supported_database_types", "description")
                : Arrays.asList("type", "type_aliases", "description");
    }
    
    private Class<? extends TypedSPI> getPluginClass(final ShowPluginsStatement sqlStatement) {
        return sqlStatement.getPluginClass().isPresent()
                ? getPluginClass(sqlStatement.getPluginClass().get())
                : TypedSPILoader.getService(PluginTypeAndClassMapper.class, sqlStatement.getType()).getPluginClass();
    }
    
    @SuppressWarnings("unchecked")
    private Class<? extends TypedSPI> getPluginClass(final String pluginClass) {
        try {
            Class<?> result = Class.forName(pluginClass);
            ShardingSpherePreconditions.checkState(TypedSPI.class.isAssignableFrom(result), () -> new UnsupportedOperationException("The plugin class to be queried must extend TypedSPI."));
            return (Class<? extends TypedSPI>) result;
        } catch (final ClassNotFoundException ignored) {
            throw new PluginNotFoundException(pluginClass);
        }
    }
    
    @Override
    public Collection<LocalDataQueryResultRow> getRows(final ShowPluginsStatement sqlStatement, final ContextManager contextManager) {
        return ShardingSphereServiceLoader.getServiceInstances(getPluginClass(sqlStatement)).stream()
                .map(each -> new PluginMetaDataQueryResultRow(each).toLocalDataQueryResultRow()).collect(Collectors.toList());
    }
    
    @Override
    public Class<ShowPluginsStatement> getType() {
        return ShowPluginsStatement.class;
    }
}

View on GitHub (pinned to e952770a21)

Solutions

  1. Install the plugin JAR into the plugin directory of the deployment.
  2. Check that the plugin name in SHOW PLUGINS matches an actually deployed plugin class.
  3. Fix typos in the requested plugin class name.

When it happens

Trigger: SHOW PLUGINS execution cannot locate the requested plugin class on the classpath.

Common situations: Querying plugin information for a plugin whose JAR was not deployed to the agent or proxy lib directory.


AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14). Data as JSON: /api/errors/79d533beea3a7a96. Report an issue: GitHub.