Results 1 to 2 of 2

Thread: Problems configuring Batch Admin with existing project

  1. #1
    Join Date
    Mar 2013
    Posts
    2

    Unhappy Problems configuring Batch Admin with existing project

    I have an existing batch admin project and I want to add Batch Admin. I haven't found any guides on how to integrate admin with already working batch project, only few lines of advice at the admin project homepage. I copied three admin jar's into existing project's WEB-INF/lib folder, added servlet definiton into web.xml and "resourceService" bean into applicationContext.xml. Problem is that my current batch application doesn't use batch properties files at all, instead it uses JNDI:

    Code:
    <jee:jndi-lookup id="batchDataSource" jndi-name="BatchDB" resource-ref="true" />
    
      <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="batchDataSource" />
      </bean>
    And when i run my application with admin support it says:

    Invalid bean definition with name 'dataSource' defined in "/content/ecl-local.war/WEB-INF/lib/spring-batch-admin-manager-1.2.1.RELEASE.jar/META-INF/spring/batch/bootstrap/manager/data-source-context.xml": Could not resolve placeholder 'batch.jdbc.driver' in string value "${batch.jdbc.driver}"
    No suprise, because I havent defined such properties, because I don't need them. Do I really need to define my database in batch properties values or is there any better solution. I rather avoid batch.properties.

  2. #2
    Join Date
    Jan 2013
    Posts
    5

    Default

    If you want to use the data source of your application server, you can define a batch.properties file and leave empty values for the required properties, so you don't need to define database configuration, but still need the batch.properties file. I'm also interested if someone knows a way to avoid adding this file.

    If you want to override the data source defined by Spring Batch Admin, you should name it dataSource, and in a more general way, if you want to override beans of Spring Batch Admin, like the transactionManager for instance: (from Spring Batch In Action Appendix B: Managing Spring Batch Admin) :

    There are two conditions for overriding to work:
    1. The bean must have the same ID as the bean defined in the Spring Batch Admin configuration.
    2. The bean definition must be loaded after Spring Batch Admin bean definitions
    In order to do #2 you need to declare your beans in files located in the /META-INF/spring/batch/override/ directory.

    Hope this helps

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •