title: Spring Batch Admin: Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"
body: <p>I am trying to integrate spring batch with spring batch admin. But am getting this error <code>Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"</code> Please help.Thanks.</p>
  
  <pre><code>enter code hereorg.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in URL [jar:file:/C:/Users/dimakatso.bopape/.gradle/caches/modules-2/files-2.1/org.springframework.batch/spring-batch-admin-manager/2.0.0.BUILD-SNAPSHOT/82b20b57e2c2e2d910d7b2c37bf58c6976071f1/spring-batch-admin-manager-2.0.0.BUILD-SNAPSHOT.jar!/META-INF/spring/batch/bootstrap/manager/data-source-context.xml]: Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"
  at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:211)
  at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:222)
  at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86)
  at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)
  at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:166)
  at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:678)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:520)
  at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:760)
  at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:360)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185)
  at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174)
  at za.co.momentum.retail.minion.batch.MinionBatchApplication.main(MinionBatchApplication.java:21)
  </code></pre>
  
  <p>Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"
      at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
      at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126)
      at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:258)
      at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:282)
      at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:204)
      at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:141)
      at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:82)
      at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:208)
      ... 13 common frames omitted</p>
  
  <p><strong>resources/batch-db2.properties</strong></p>
  
  <pre><code>spring.jpa.hibernate.dialect: org.hibernate.dialect.DB2Dialect
  spring.jpa.show-sql: false
  spring.jpa.generate-ddl: false
  
  database.minion.url=jdbc:db2://***
  database.minion.username=***
  database.minion.password=***
  database.minion.driver-class-name=com.ibm.db2.jcc.DB2Driver
  </code></pre>
  
  <p><strong>resources/application.properties</strong></p>
  
  <pre><code>server.port=8091
  -DENVIRONMENT=db2
  </code></pre>
  
  <p><strong>main class</strong></p>
  
  <pre><code>@ComponentScan(basePackageClasses={ PersistenceConfig.class })
  @SpringBootApplication(exclude = {HypermediaAutoConfiguration.class, MultipartAutoConfiguration.class})
  @EnableBatchAdmin
  public class MinionBatchApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MinionBatchApplication.class, args);
      }
  }
  </code></pre>
  
  <p><strong>Data source config</strong></p>
  
  <pre><code>@Configuration
  public class PersistenceConfig {
  
    @Bean
      @ConfigurationProperties(prefix = "database.minion")
      public DataSource minionDataSource() {
          return DataSourceBuilder
              .create()
              .build();
      }}
  </code></pre>