{"record":{"id":"1820947e2944420a","repo":"hibernate/hibernate-orm","slug":"could-not-instantiate-connection-provider","errorCode":null,"errorMessage":"Could not instantiate connection provider [{}]","messagePattern":"Could not instantiate connection provider \\[(.+?)\\]","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java","lineNumber":139,"sourceCode":"\t}\n\n\tprivate static Class<? extends ConnectionProvider> connectionProviderClass(Class<?> providerClass) {\n\t\tif ( !ConnectionProvider.class.isAssignableFrom( providerClass ) ) {\n\t\t\tthrow new ConnectionProviderConfigurationException( \"Class '\" + providerClass.getName()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"' does not implement 'ConnectionProvider'\" );\n\t\t}\n\t\treturn providerClass.asSubclass( ConnectionProvider.class );\n\t}\n\n\tprivate ConnectionProvider instantiateNamedConnectionProvider(\n\t\t\tString providerName, StrategySelector strategySelector, BeanContainer beanContainer) {\n\t\tCONNECTION_PROVIDER_LOGGER.instantiatingExplicitConnectionProvider( providerName );\n\t\tfinal var providerClass = strategySelector.selectStrategyImplementor( ConnectionProvider.class, providerName );\n\t\ttry {\n\t\t\treturn instantiateExplicitConnectionProvider( providerClass, beanContainer );\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new HibernateException( \"Could not instantiate connection provider [\" + providerName + \"]\", e );\n\t\t}\n\t}\n\n\tprivate ConnectionProvider instantiateConnectionProvider(\n\t\t\tMap<String, Object> configurationValues, StrategySelector strategySelector, BeanContainer beanContainer) {\n\t\tif ( configurationValues.containsKey( DATASOURCE ) ) {\n\t\t\treturn new DataSourceConnectionProvider();\n\t\t}\n\n\t\tfinal var singleRegisteredProvider = getSingleRegisteredProvider( strategySelector );\n\t\tif ( singleRegisteredProvider != null ) {\n\t\t\ttry {\n\t\t\t\treturn singleRegisteredProvider.getConstructor().newInstance();\n\t\t\t}\n\t\t\tcatch (IllegalAccessException | NoSuchMethodException | InvocationTargetException | InstantiationException e) {\n\t\t\t\tthrow new HibernateException( \"Could not instantiate singular-registered ConnectionProvider\", e );\n\t\t\t}\n\t\t}","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java#L121-L157","documentation":"Error \"Could not instantiate connection provider [{}]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java:139 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the connection provider class has an accessible no-arg constructor and is on the classpath","Check the provider configuration for typos and missing dependencies"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}