title: Spring boot configuration properties issue
body: <p>I have been working on creating a custom data source bean. The code and .properties file is below:</p>
  
  <pre><code>@Configuration
  @EnableConfigurationProperties
  @EnableWebMvc
  public class ConfigClass {
  
      @Bean(name="DbDataSource", destroyMethod="close")
      @ConfigurationProperties(prefix="db.datasource")
      public DataSource dbDataSource() {
          DataSource ds;
          ds = DataSourceBuilder.create().build();
          return  ds;
      }
      @Bean(name = "taxTransactionManager")
      public JpaTransactionManager getJpaTransactionManager(){
      JpaTransactionManager transactionManager = new JpaTransactionManager();
      transactionManager.setDataSource(dbDataSource());
      }
  </code></pre>
  
  <p>=======================================================================</p>
  
  <pre><code>#db datasource
  db.datasource.type=javax.sql.DataSource
  db.datasource.driver-class-name=oracle.jdbc.OracleDriver
  </code></pre>
  
  <p>The problem is it doesn't seem to be loading/applying the properties to the data source bean because I keep getting the following error:</p>
  
  <pre><code>The persistence provider is attempting to use properties in the persistence.xml file to resolve the data source. A Java Database Connectivity (JDBC) driver or data source class name must be specified in the openjpa.ConnectionDriverName or javax.persistence.jdbc.driver property. The following properties are available in the configuration: "org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl@982e6a52". 
      at org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:72)
      at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:849)
      at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:732)
      at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
  </code></pre>
  
  <p>I have tried putting the configuration in all one file and I have also tried using separate files and referencing one config file in another as shown below:</p>
  
  <pre><code>@Configuration
  @EnableConfigurationProperties
  public class ConfigClass {
      @Bean(name="dbDataSource", destroyMethod="close")
      @ConfigurationProperties(prefix="posdb.datasource")
      public DataSource dbDataSource() {
          return DataSourceBuilder.create().build();
      }}
  </code></pre>
  
  <p>========================================================</p>
  
  <pre><code>@Configuration
  @Import(ConfigClass.class)
  public class ConfigClass2{
  
  @Autowired
  ConfigClass config1;
  
          @Bean(name = "genericTransactionManager")
          public JpaTransactionManager getJpaTransactionManager(){
          JpaTransactionManager transactionManager = new JpaTransactionManager();
          transactionManager.setDataSource(config1.dbDataSource());
          return transactionManager;
      }}
  </code></pre>
  
  <p>The config class is being imported to configure and run my application below:</p>
  
  <pre><code>@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,
      SessionAutoConfiguration.class,DataSourceTransactionManagerAutoConfiguration.class,
      JpaRepositoriesAutoConfiguration.class,JndiDataSourceAutoConfiguration.class,JndiConnectionFactoryAutoConfiguration.class,
      RedisAutoConfiguration.class})
  @Import(ConfigClass.class)
  public class ServiceBootstrap {
  
      public static void main(String[] args) {
          SpringApplication.run(ServiceBootstrap.class, args);
      }
  }
  </code></pre>
  
  <p>The spring boot app is in another project and the config class is being imported making this a dependency project. I have also tried to import my ConfigClass2 in the ServiceBootstrap class and I am still getting the same error. Also I tried to autowire the data source bean itself instead of the config class and the bean came back as null. Does anyone know what may be causing this problem?</p>