title: java.sql.SQLException: The url cannot be null [Multi modules App]
body: <p>I want to access to my web app by using an oauth2 server.</p>
  
  <p>The authentification pass well and I am redirected to my web app.</p>
  
  <p>But the problem is that when I try to load datas from my data base, I get this</p>
  
  <p>exception : </p>
  
  <pre><code>    janv. 31, 2017 1:16:07 PM org.apache.tomcat.jdbc.pool.PooledConnection connectUsingDriver
      AVERTISSEMENT: Not loading a JDBC driver as driverClassName property is null.
      janv. 31, 2017 1:16:07 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
      GRAVE: Unable to create initial connections of pool.
      java.sql.SQLException: The url cannot be null
  </code></pre>
  
  <p>Can someone help me please.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have a separate config module where I setup my DB connection. And I add this module like a dependency in my web app.</p>
  
  <p>My application.properties file</p>
  
  <pre><code># DataSource configuration
  datasource.host=localhost
  datasource.name=my-db
  datasource.port=5432
  
  datasource.username=my-user
  datasource.password=my-password
  
  datasource.url=jdbc:postgresql://${datasource.host}:${datasource.port}/${datasource.name}
  datasource.driver.class.name=org.postgresql.Driver
  </code></pre>
  
  <p>My config class (I am using myBatis like ORM)</p>
  
  <pre><code>@Configuration
  @MapperScan(basePackages = {"com.package.mapper"})
  @ComponentScan(basePackages = {"com.package.repository"})
  public class MyBatisConfig {
  
    @Value("${datasource.driver.class.name}")
    private String dbDriverClassName;
  
    @Value("${datasource.url}")
    private String dbUrl;
  
    @Value("${datasource.username}")
    private String dbUsername;
  
    @Value("${datasource.password}")
    private String dbPassword;
  
    @Bean
    public DataSource getDataSource() {
      return DataSourceBuilder
          .create()
          .url(dbUrl)
          .driverClassName(dbDriverClassName)
          .username(dbUsername)
          .password(dbPassword)
          .build();
    }
  
    @Bean
    public SqlSessionFactory sqlSessionFactory() throws Exception {
      SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
      sessionFactory.setConfigLocation(new ClassPathResource("META-INF/spring/mybatis-config.xml"));
      sessionFactory.setDataSource(getDataSource());
      return sessionFactory.getObject();
    }
  
    @Bean
    public DataSourceTransactionManager transactionManager() {
      return new DataSourceTransactionManager(getDataSource());
    }
  }
  </code></pre>