prestodb/presto · critical · RuntimeException
JDBC driver class not found: {config.getJdbcDriverName()}
Error message
JDBC driver class not found: {config.getJdbcDriverName()} What it means
SessionPropertiesDaoProvider connects to the config database over JDBC using Jdbi. Before creating connections it calls Class.forName on the configured driver class so DriverManager can load it. If the driver class named in config.getJdbcDriverName() is not on the classpath, the provider throws a RuntimeException wrapping the ClassNotFoundException during construction, so the DB-backed session property manager fails to initialize.
Source
Thrown at presto-db-session-property-manager/src/main/java/com/facebook/presto/session/db/SessionPropertiesDaoProvider.java:41
import static java.util.Objects.requireNonNull;
public class SessionPropertiesDaoProvider
implements Provider<SessionPropertiesDao>
{
private final SessionPropertiesDao dao;
@Inject
public SessionPropertiesDaoProvider(DbSessionPropertyManagerConfig config)
{
requireNonNull(config, "config is null");
requireNonNull(config.getConfigDbUrl(), "db url is null");
try {
Class.forName(config.getJdbcDriverName());
}
catch (ClassNotFoundException e) {
throw new RuntimeException("JDBC driver class not found: " + config.getJdbcDriverName(), e);
}
this.dao = Jdbi.create(() -> DriverManager.getConnection(config.getConfigDbUrl()))
.installPlugin(new SqlObjectPlugin())
.onDemand(SessionPropertiesDao.class);
}
@Override
public SessionPropertiesDao get()
{
return dao;
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Add the JDBC driver jar matching config.getJdbcDriverName() to the server/plugin classpath (e.g. mysql-connector-j or postgresql)
- Verify the driver class name in configuration is correct and fully qualified (e.g. com.mysql.cj.jdbc.Driver, org.postgresql.Driver)
- Check the deployment artifact/build to ensure the driver dependency is included and not marked provided/excluded
- Restart the coordinator after adding the driver so the classloader picks it up
Example fix
// before (config.properties) session-property-manager.db.url=jdbc:mysql://db:3306/config # driver jar missing // after # add mysql-connector-j.jar to the plugin/classpath and set db.session-properties.jdbc-driver-name=com.mysql.cj.jdbc.Driver
Defensive patterns
Strategy: validation
Validate before calling
String driverName = config.getJdbcDriverName();
try {
Class.forName(driverName);
} catch (ClassNotFoundException e) {
throw new IllegalStateException("JDBC driver not on classpath: " + driverName
+ ". Add the driver jar to the plugin/classpath.", e);
} Type guard
boolean isJdbcDriverPresent(String driverClass) {
try { Class.forName(driverClass); return true; }
catch (ClassNotFoundException e) { return false; }
} Try / catch
try {
new SessionPropertiesDaoProvider(config, ...);
} catch (RuntimeException e) {
if (e.getMessage() != null && e.getMessage().startsWith("JDBC driver class not found")) {
// log actionable hint: check getJdbcDriverName() and classpath
throw new ConfigurationException("Add the JDBC driver jar named in config to the classpath", e);
}
throw e;
} Prevention
- Ship the JDBC driver jar with the deployment and verify it in the startup script or Docker image
- Pin and double-check the fully qualified driver class name in config (com.mysql.cj.jdbc.Driver vs com.mysql.jdbc.Driver)
- Smoke-test DB-backed session property manager init in CI with the same classpath as production
- Keep driver dependency scope correct (runtime, not provided) in the build
When it happens
Trigger: Constructing SessionPropertiesDaoProvider (via its public constructor, e.g. in the Guice module) when config.getJdbcDriverName() names a class absent from the classpath; usually a MySQL/Postgres driver jar missing at server startup.
Common situations: Deployment without the JDBC driver jar (e.g. MySQL connector not packaged or not on the plugin classpath); typo in the driver class name in config properties; switching databases (MySQL to Postgres) without changing the driver config; shaded/uber-jar that excludes JDBC drivers.
Related errors
- EMR File System class not found:
- JDBC_ERROR
- Only one of 'case-insensitive-name-matching=true' or 'case-s
- connection-url is required but was not provided
- PERMISSION_DENIED
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/4b8f930950ee8817.
Report an issue: GitHub.