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

  • Spring batch admin configuration for pointing the database

    Hi,

    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 batch-hsql.properties 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".

    Comment


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

      Hi,

      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
      d
      org.springframework.beans.factory.BeanDefinitionSt oreException: Invalid bean def
      inition with name 'dataSource' defined in URL [jar:file:/C:/apache-tomcat-6.0.33
      -windows-x64/webapps/SP2-1.0/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEAS
      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.

      Thanks!

      Comment

      Working...
      X