Announcement Announcement Module
No announcement yet.
Stoping -Spring batch Job Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    You need to set up the database with the correct tables. There are scripts in the core jar file.

    I wouldn't recommend Derby for production use, and you may see strange behaviour with pagination.


    • #17
      Dave ,

      I Started using Mysql as my DB , Created all the tables required started job using the below command .

      mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -Dexec.args="ingestor-config.xml job"

      After some time i wanted to stop my job , I used below command to stop

      mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -stop -Dexec.args="ingestor-config.xml job"

      JOb didn't stop it was still running , is it not possible to stop a job using this command ?\

      Exact Error :

      2011-02-21 15:16:02,454 [mmandLineJobRunner.main()] ERROR CommandLineJobRunner - Job Terminated in error: A job execution for this job is already running: JobInstance: id=10, JobParameters=[{}], Job=[job]
      org.springframework.batch.core.repository.JobExecu tionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=10, JobParameters=[{}], Job=[job]
      Last edited by didilip; Feb 21st, 2011, 03:47 AM.


      • #18
        I think there's a typo in your command line (-stop should be in the arguments to the main method). Does that fix it?


        • #19
          did you mean like

          mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -stop -Dexec.args="ingestor-config.xml job -stop"


          vn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -Dexec.args="ingestor-config.xml job -stop"

          if yes , These commads are n ot stoping the job , instead throwing the same error as shown above .



          • #20
            That's what I meant (either should work). What version of Spring Batch are you using?


            • #21
              2.0.4 - version


              • #22
                Today i upgraded to version 2.1.5 Release version of Spring batch ,,,

                Still my issue continues ..

                Enclosed is my config file .


                • #23
                  Note that 2.1.6 is the latest. It works for me. Maybe you can try with a simple fake sample (e.g. the simple-cli) and check you can make that work?


                  • #24
                    I used simple-cli example for testing purpose ..

                    from a command prompt gave below command

                    mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -Dexec.args="launch-context.xml job1"

                    job started running and printing o/p on consloe .

                    Now i opened one more command prompt window fro same path and gave below command

                    mvn exec:java -Dexec.mainClass=org.springframework.batch.core.lau -Dexec.args="launch-context.xml job1 -stop"

                    This command i was expecting to stop the job running . but it was not stopped . Am i going wrong some where???


                    • #25
                      What happened with the simple cli (any exception, or you just didn't see the job stop)? It won't be using a shared database by default, so it's no surprise if you haven't changed the database configuration.

                      For your original problem, the -stop flag was never supported in Batch 2.0, and you mentioned you had been using 2.0.4, so I would check very carefully that you don't have older versions on the jars on your classpath by mistake.


                      • #26
                        Stoping a Batch Process

                        Hi All,

                        Stop the process with a click of a button

                        I invoke the batch process from gui by click of a button .

                        The Control Moves from Spring Controller-Quartzs Scheduler-then the batch process gets invoked form Quartz -Execute method invokes batch process ,
                        I am using WebSphere as application server ,
                        Can any one help me in deriving a solution to stop the batch process through screens(gui).


                        • #27
                          Have you tried this:


                          • #28
                            Hi Dave

                            I was able to see job stopping using the Junit test case .. where job will be stopped after few seconds ..

                            But when i use a command prompt to stop a job .

                            I see an Error saying thier is no job running for the joblauncher job1.

                            As i digged log :

                            Found that when i run a job using a test case in the job parameter list it shows the job running id and excutes the job ..
                            But when i use a command prompt in job parmeter is empy ..

                            is their any changes i have to make to the command so that it can take jobparemeters id ?

                            I am using the same db which has been used in example.