pentaho/pentaho-kettle · error · UnsupportedOperationException
getClass().getName() + " does not support providing pooled…
Error message
getClass().getName() + " does not support providing pooled data sources"
What it means
The JNDI/POOLED DataSourceProvider implementation of getNamedDataSource(type, name) throws UnsupportedOperationException for DatasourceType.POOLED because this class only resolves datasources through JNDI; it does not manage its own connection pool. The message names the concrete class that lacks the capability.
Solutions
- Use DatasourceType.JNDI and ensure the datasource is bound in JNDI instead of requesting POOLED.
- Inject/replace with a provider implementation that supports pooled datasources (e.g. one backed by a pool library).
- Validate the configured DatasourceType against the provider's capabilities before the call.
- Catch UnsupportedOperationException and fall back to a JNDI lookup.
Example fix
// before DataSource ds = provider.getNamedDataSource( DatasourceType.POOLED, "myDs" ); // after DataSource ds = provider.getNamedDataSource( DatasourceType.JNDI, "myDs" );
Defensive patterns
Strategy: validation
Validate before calling
if ( type == DatasourceType.POOLED ) {
throw new IllegalStateException( "This provider does not support pooled datasources; use JNDI" );
} Try / catch
try {
ds = provider.getNamedDataSource( type, name );
} catch ( UnsupportedOperationException e ) {
ds = provider.getNamedDataSource( DatasourceType.JNDI, name ); // fallback
} Prevention
- Match DatasourceType to the provider implementation actually in use
- Assert provider capabilities at startup (fail fast in config validation)
- Avoid hardcoding POOLED when deploying the JNDI-based DatabaseUtil
When it happens
Trigger: Calling getNamedDataSource(DatasourceType.POOLED, datasourceName) — via the two-arg overload or the pooled branch of the switch in the single-arg overload's sibling method.
Common situations: Code configured with a pooled datasource type but running against the JNDI-based DatabaseUtil provider; swapping provider implementations without updating datasource type configuration; Pentaho code that expects a pooled provider in a JNDI-only deployment.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Append file in repository is not possible
- Can't copy within a sorted list.
- Can't do a indexed insert in a sorted list.
- Can't do a indexed replace in a sorted list.
- Can't fill a sorted list.
AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13).
Data as JSON: /api/errors/96b4c4634c9f4b71.
Report an issue: GitHub.
Appendix: source
Thrown at core/src/main/java/org/pentaho/di/core/database/util/DatabaseUtil.java:188
Thread.currentThread().setContextClassLoader( getClass().getClassLoader() );
return DatabaseUtil.getDataSourceFromJndi( datasourceName, new InitialContext() );
} catch ( NamingException ex ) {
throw new DataSourceNamingException( ex );
} finally {
Thread.currentThread().setContextClassLoader( original );
}
}
@Override
public DataSource getNamedDataSource( String datasourceName, DatasourceType type )
throws DataSourceNamingException {
if ( type != null ) {
switch ( type ) {
case JNDI:
return getNamedDataSource( datasourceName );
case POOLED:
throw new UnsupportedOperationException(
getClass().getName() + " does not support providing pooled data sources" );
}
}
throw new IllegalArgumentException( "Unsupported data source type: " + type );
}
@Override public DataSource invalidateNamedDataSource( String datasourceName, DatasourceType type )
throws DataSourceNamingException {
switch ( type ) {
case POOLED:
return ConnectionPoolUtil.removeDataSource( datasourceName );
default:
return FoundDS.remove( datasourceName );
}
}
}
View on GitHub (pinned to f3058517a1)