Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6323629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:33:19+00:00 2026-05-24T16:33:19+00:00

I am trying to use spring batch & quartz in a project. The objective

  • 0

I am trying to use spring batch & quartz in a project. The objective is to schedule a spring-batch job using Quartz. I have the following beans –

bean id="updateDataFeedJob"  class="package.UpdateDataFeedJob" />     

<bean id="UpdaterOnScheduleJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="updateDataFeedJob"/>
    <!-- the method to call inside of com.siemens.scr.schedule.UpdateDataFeedJob -->
    <property name="targetMethod" value="execute"/>
</bean> 

<bean id="cronTriggerId" class="org.springframework.scheduling.quartz.CronTriggerBean">
    <property name="jobDetail" ref="UpdaterOnScheduleJobDetail" />
    <!-- run every morning at 3AM -->
    <!--  <property name="cronExpression" value="0 0 3 * * ?" /> -->

    <!-- Fires every five minutes -->
    <property name="cronExpression" value="0 0/5 * * * ?" />
</bean>

<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="triggers">
        <list>
            <ref bean="cronTriggerId" />
        </list>
    </property>
</bean>

The UpdateDataFeedJob is –

public class UpdateDataFeedJob  {   
  public void execute() throws Exception {
    System.out.println("Hello World. Running the job");
    CommandLineJobRunner.main(new String[]{"GetFleetUpdatesJob.xml", "getFleetUpdatesJob"});
  }  
}

Sample Calling is –

public class Client {
    public static void main(String[] args){
        //CommandLineJobRunner.main(new String[]{"GetFleetUpdatesJob.xml", "getFleetUpdatesJob"});
        new ClassPathXmlApplicationContext("GetFleetUpdatesJob.xml");
    }   
}

I keep getting the following exception –

ERROR - Job Terminated in error: A job execution for this job is already running: JobInstance: id=0, JobParameters=[{}], Job=[getFleetUpdatesJob]
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=0, JobParameters=[{}], Job=[getFleetUpdatesJob]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.createJobExecution(SimpleJobRepository.java:112)
    at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:98)
    at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:291)
    at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:448)
    at com.siemens.scr.schedule.UpdateDataFeedJob.execute(UpdateDataFeedJob.java:10)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:33:19+00:00Added an answer on May 24, 2026 at 4:33 pm

    I got this working. I am not aware of the exact reason & will appreciate if someone can comment –

    I added the following bean config in the applicationContext.xml

    <bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager"/>
    

    Now i dont get that exception & quartz is able to call the spring batch job

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

good people. i'm trying to use quartz with spring in a very simple project
I have a Spring MVC application trying to use a rich domain model, with
I'm trying to use protobuf in a C# project, using protobuf-net, and am wondering
I am trying to use the library spring-json.1.3.1 in a project that has been
I am trying to use Spring batch and implement an aggregated reader (batch file,
I have been trying to use Spring in my Java EE projects and while
I'm trying to use Spring IoC with an interface like this: public interface ISimpleService<T>
I am trying to use Spring.NET with a C# application to populate a parameter
I'm trying to use UTF-8 encoding for the Spring application I'm developing but I
I´m trying to change a spring jsp example to use freemarker. I changed all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.