Announcement Announcement Module
No announcement yet.
How to start the job? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to start the job?

    Hello All,

    I am pretty new to Spring Batch, but I am pretty impressed with its features and usecases and am planning to use it in our project.

    I downloaded everything (samples, distribution etc) and have added that into my Eclipse project. I am using mysql database and can successfully run org.springframework.batch.sample.launch.TaskExecut orLauncher and use mysql scripts that came with the package.

    Everything went just fine, the scripts created all the tables, even the business mysql script ran successfully and created all business tables.

    But my program always stops at "Started application. Please connect using JMX (remember to use if you can't see anything in Jconsole)."

    It says the application is started, I am pretty much sure that it didnt run the job, as it batchUpdateJob is what I am trying to run (from samples) and it did not update anything in the table.

    Can you help me to understand where am I? What should I do to run the job? Is there a simple hello world job that I can run?? Is there blank jar file like spring-blank.jar file to get started with a project from scratch??

    Any help to get started with my first job should be GREAT!! I am pretty much comfortable with the rest of the architecture, just trying to find the kick-start.

    Any article or document that describes what are the minimum things required to get going for an simple hello world job would be GREAT.

    Also I do not see any other output? It asks me to attach JMX by providing JVM arguments described about, but even that did not help.

    Last edited by hailspring; Apr 12th, 2008, 09:03 AM.

  • #2
    I'm glad the framework will be useful for you on your project. The documentation is still a bit weak in the area of the samples, it's something that definitely needs to be addressed. I also agree 100% that there needs to be a much smaller sample job to get started. I started making one just before the release but got a bit busy with other tasks.

    The TaskExecutorLauncher that you are running is intended to show you a job can be launched via jmx. So if you started jconsole from the command line you would be able to launch jobs that way. It's probably not the best place to get started though as it's a much more advanced feature of the framework. Most of our samples jobs are launched via JUnit. I know this a bit weird, but we also use them as 'functional tests' to ensure that all the features work in an actual batch job, they're even run as part of our CI process. If you look in chapter 7 of the reference documentation there are details about how this works. If you navigate to the src/test/java directory in the samples project and open the org.springframework.batch.sample package, you should see a lot of classes ending in 'FunctionalTests'. Launch any one of these as a JUnit test and it will run the batch job from end to end (validating the results at the end) You should be able to run them against mysql as well, even if you launch from JUnit.


    • #3

      Thanks!! I got everything working now... could successfully run the batch trade job.