Announcement Announcement Module
No announcement yet.
JNDI from Spring Batch issue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JNDI from Spring Batch issue


    All of our applications run in Tomcat (tcServer) and use JNDI datasources.

    We want to reuse some of our business logic for a batch job.

    I would like to use Spring Batch, but how does Spring Batch get a JNDI resource when it doesn't run inside Tomcat? There is no JNDI server on the box that runs our batch jobs.

    If I install Tomcat on our box, can a batch job running OUTSIDE of Tomcat access the JNDI datasource factory running INSIDE Tomcat?


    Last edited by trulore; Nov 8th, 2012, 04:53 PM.

  • #2
    This really isn't a batch question as it is just a question about setting up your data sources. To utilize the JNDI registry inside tomcat from your batch jobs (and not have the batch jobs run within the container), you'll have to configure your jobs to use tomcat as the JNDI provider.

    I have to ask, why is the business logic coupled to the use of JNDI datasources? Can't you just package that up separately (as a jar) and import it into your batch projects?