title: Hibernate 5.2.14 & C3P0: C3P0 using driver: null at URL: null (no XML at all)
body: <p>my HibernateConfiguration class:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @PropertySource({ "classpath:core.properties" })
  @ComponentScan({ "com.test.core.domain" })
  @EnableJpaRepositories(basePackages = "com.test.core.domain.dao")
  public class HibernateConfiguration {
      private static Logger logger = Logger.getLogger(HibernateConfiguration.class);
  
      @Autowired private Environment env;
  
      @Bean
      public LocalSessionFactoryBean entityManagerFactory() {
          LocalSessionFactoryBean localSessionFactoryBean = new LocalSessionFactoryBean();
          localSessionFactoryBean.setDataSource(dataSource());
          localSessionFactoryBean.setPackagesToScan(new String[] { "com.test.core.domain.*" });
          localSessionFactoryBean.setHibernateProperties(additionalProperties());
          return localSessionFactoryBean;
      }
  
      @Bean
      public DataSource dataSource() {
          ComboPooledDataSource сomboPooledDataSource = new ComboPooledDataSource();
          try {
              сomboPooledDataSource.setDriverClass(Preconditions.checkNotNull(env.getProperty("jdbc.driverClassName")));
          } catch( PropertyVetoException pve ){
              logger.error("Cannot load datasource driver (" + env.getProperty("jdbc.driverClassName") +"): " + pve.getMessage());
              return null;
          }
  
          сomboPooledDataSource.setJdbcUrl(Preconditions.checkNotNull(env.getProperty("jdbc.url")));
          сomboPooledDataSource.setUser(Preconditions.checkNotNull(env.getProperty("edrive.jdbc.user")));
          сomboPooledDataSource.setPassword(Preconditions.checkNotNull(env.getProperty("edrive.jdbc.pass")));
  
          сomboPooledDataSource.setMinPoolSize(20);
          сomboPooledDataSource.setMaxPoolSize(50);
          сomboPooledDataSource.setCheckoutTimeout(15);
          сomboPooledDataSource.setMaxStatements(0);
          сomboPooledDataSource.setIdleConnectionTestPeriod(30);
  
          return сomboPooledDataSource;
      }
  
      @Bean
      public PlatformTransactionManager transactionManager(EntityManagerFactory emf){
          JpaTransactionManager transactionManager = new JpaTransactionManager();
          transactionManager.setEntityManagerFactory(emf);
  
          return transactionManager;
      }
  
      @Bean
      public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
          return new PersistenceExceptionTranslationPostProcessor();
      }
  
      private Properties additionalProperties() {
          Properties properties = new Properties();
          properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQL95Dialect");
          properties.setProperty("hibernate.bytecode.use_reflection_optimizer", "true");
          properties.setProperty("hibernate.show_sql", "false");
          properties.setProperty("hibernate.default_batch_fetch_size", "1000");
          properties.setProperty("hibernate.max_fetch_depth", "2");
          properties.setProperty("hibernate.generate_statistics", "false");
          properties.setProperty("hibernate.default_schema", "EDRIVE");
  
          properties.setProperty("hibernate.connection.CharSet", "utf8");
          properties.setProperty("hibernate.connection.characterEncoding", "utf8");
          properties.setProperty("hibernate.connection.useUnicode", "true");
          properties.setProperty("hibernate.connection.provider_class", "org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider");
          properties.setProperty("hibernate.connection.release_mode", "after_transaction");
  
          properties.setProperty("hibernate.jdbc.batch_size", "50");
          properties.setProperty("hibernate.jdbc.fetch_size", "500");
          properties.setProperty("hibernate.jdbc.use_scrollable_resultset", "false");
  
          properties.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory");
          properties.setProperty("hibernate.cache.use_query_cache", "true");
          properties.setProperty("hibernate.cache.use_second_level_cache", "true");
          properties.setProperty("hibernate.cache.use_structured_entries", "false");
  
          properties.setProperty("hibernate.current_session_context_class", "thread");
  
          return properties;
      }
  }
  </code></pre>
  
  <p>Properties file:</p>
  
  <pre><code>jdbc.driverClassName=org.postgresql.Driver
  jdbc.url=jdbc:postgresql://www:5434/edrived1
  
  edrive.jdbc.user=services
  edrive.jdbc.pass=*********
  </code></pre>
  
  <p>When I start my web app, I get following message and exception in the log:</p>
  
  <blockquote>
    <p>2018-03-17 13:59:34 INFO  C3P0ConnectionProvider:117 - HHH010002: C3P0
    using driver: null at URL: null 2018-03-17 13:59:34 INFO 
    C3P0ConnectionProvider:118 - HHH10001001: Connection properties:
    {useUnicode=true, handling_mode=DELAYED_ACQUISITION_AND_HOLD,
    CharSet=utf8, characterEncoding=utf8, release_mode=after_transaction}
    2018-03-17 13:59:34 INFO  C3P0ConnectionProvider:121 - HHH10001003:
    Autocommit mode: false 2018-03-17 13:59:34 WARN 
    C3P0ConnectionProvider:124 - HHH10001006: No JDBC Driver class was
    specified by property hibernate.connection.driver_class</p>
  </blockquote>
  
  <p>...</p>
  
  <blockquote>
    <p>2018-03-17 13:59:34 DEBUG BasicResourcePool:207 - An exception
    occurred while acquiring a poolable resource. Will retry.
    java.sql.SQLException: No suitable driver     at
    java.sql.DriverManager.getDriver(DriverManager.java:315)  at
    com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285)
      at
    com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:161)
      at
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161)
      at
    com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147)
      at
    com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:202)
      at
    com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
      at
    com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
      at
    com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)   at
    com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
      at
    com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)</p>
  </blockquote>
  
  <p>Here is a log of configuration of bean:</p>
  
  <blockquote>
    <p>2018-03-17 14:09:50 DEBUG PropertySourcesPropertyResolver:115 - Found
    key 'jdbc.driverClassName' in PropertySource 'class path resource
    [core.properties]' with value of type String 2018-03-17 14:09:50 DEBUG
    JndiTemplate:154 - Looking up JNDI object with name
    [java:comp/env/jdbc.url] 2018-03-17 14:09:50 DEBUG
    JndiLocatorDelegate:102 - Converted JNDI name [java:comp/env/jdbc.url]
    not found - trying original name [jdbc.url].
    javax.naming.NameNotFoundException: Name [jdbc.url] is not bound in
    this Context. Unable to find [jdbc.url]. 2018-03-17 14:09:50 DEBUG
    JndiTemplate:154 - Looking up JNDI object with name [jdbc.url]
    2018-03-17 14:09:50 DEBUG JndiPropertySource:101 - JNDI lookup for
    name [jdbc.url] threw NamingException with message: Name [jdbc.url] is
    not bound in this Context. Unable to find [jdbc.url].. Returning null.
    2018-03-17 14:09:50 DEBUG PropertySourcesPropertyResolver:115 - Found
    key 'jdbc.url' in PropertySource 'class path resource
    [core.properties]' with value of type String 2018-03-17 14:09:50 DEBUG
    JndiTemplate:154 - Looking up JNDI object with name
    [java:comp/env/edrive.jdbc.user] 2018-03-17 14:09:50 DEBUG
    JndiLocatorDelegate:102 - Converted JNDI name
    [java:comp/env/edrive.jdbc.user] not found - trying original name
    [edrive.jdbc.user]. javax.naming.NameNotFoundException: Name
    [edrive.jdbc.user] is not bound in this Context. Unable to find
    [edrive.jdbc.user]. 2018-03-17 14:09:50 DEBUG JndiTemplate:154 -
    Looking up JNDI object with name [edrive.jdbc.user] 2018-03-17
    14:09:50 DEBUG JndiPropertySource:101 - JNDI lookup for name
    [edrive.jdbc.user] threw NamingException with message: Name
    [edrive.jdbc.user] is not bound in this Context. Unable to find
    [edrive.jdbc.user].. Returning null. 2018-03-17 14:09:50 DEBUG
    PropertySourcesPropertyResolver:115 - Found key 'edrive.jdbc.user' in
    PropertySource 'class path resource [core.properties]' with value of
    type String 2018-03-17 14:09:50 DEBUG JndiTemplate:154 - Looking up
    JNDI object with name [java:comp/env/edrive.jdbc.pass] 2018-03-17
    14:09:50 DEBUG JndiLocatorDelegate:102 - Converted JNDI name
    [java:comp/env/edrive.jdbc.pass] not found - trying original name
    [edrive.jdbc.pass]. javax.naming.NameNotFoundException: Name
    [edrive.jdbc.pass] is not bound in this Context. Unable to find
    [edrive.jdbc.pass]. 2018-03-17 14:09:50 DEBUG JndiTemplate:154 -
    Looking up JNDI object with name [edrive.jdbc.pass] 2018-03-17
    14:09:50 DEBUG JndiPropertySource:101 - JNDI lookup for name
    [edrive.jdbc.pass] threw NamingException with message: Name
    [edrive.jdbc.pass] is not bound in this Context. Unable to find
    [edrive.jdbc.pass].. Returning null. 2018-03-17 14:09:50 DEBUG
    PropertySourcesPropertyResolver:115 - Found key 'edrive.jdbc.pass' in
    PropertySource 'class path resource [core.properties]' with value of
    type String 2018-03-17 14:09:50 DEBUG DefaultListableBeanFactory:573 -
    Eagerly caching bean 'dataSource' to allow for resolving potential
    circular references</p>
  </blockquote>
  
  <p>All properties are set in the corresponding core.properties file, database is alive and works fine with Hibernate 5.1 and XML config. Now I would like to migrate to Spring Boot 2, so, I need to convert my configurations to XMLless stuff. What is going wrong with my current implementation?</p>