Announcement Announcement Module
No announcement yet.
Spring batch admin configuration for pointing the database Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring batch admin configuration for pointing the database


    I have created a standalone batch application and have configured jobrepository to persist the metadata abt job in sqlserver. Now I want to connect spring batch admin to this sqlserver so that I can monitor the metadata of already run jobs in admin UI.
    I have deployed the spring batch admin war file in apache tomcat and able to view the UI structure .
    I also have gone through the spring batch admin reference doc but not able to understand exaclty how to configure batch admin to point the databse.
    According to doc , i have configured the servlet-override.xml file from war file to point the database but no work.
    How do we need to exaclty configure batch admin in order to point it to database ?
    PLease help.

    thx in adv!

  • #2
    The simplest way is to use the existing dataSource bean and provide alternate external configuration. From the user guide:

    "To change the database type add a file to the application classpath called batch-[type].properties, where [type] is the database type you want to use (e.g. mysql, oracle, db2). Copy the contents of the from the Manager jar and change the values to suit your environment. Then launch the application with a system property -DENVIRONMENT=[type]."

    Or you can go with the override XML, as long as you put it in the right location - from the user guide "add your own versions of the same bean definitions to a Spring XML config file in META-INF/spring/batch/override" (that's in the classpath, not the war file META-INF). In that case just override the bean named "dataSource".


    • #3
      Whether database is required for running spring batch admin


      I followed the steps mentioned in ur earlier reply. I am using mysql and have batch properties for the same. After creating war file, I deployed it in tomcat server.

      "19:39:46,395 ERROR main context.ContextLoader:220 - Context initialization faile
      org.springframework.beans.factory.BeanDefinitionSt oreException: Invalid bean def
      inition with name 'dataSource' defined in URL [jar:file:/C:/apache-tomcat-6.0.33
      E.jar!/META-INF/spring/batch/bootstrap/manager/data-source-context.xml]: Could n
      ot resolve placeholder 'batch.jdbc.driver'"

      We tried with 1.0.0 version with same setup and we are able to launch the admin console (without any database). Since FILES menu is not available, we are trying with new version and facing the above issue.

      Kindly guide us how to proceed on this issue.