Results 1 to 8 of 8

Thread: How do I start - Any examples?

  1. #1
    Join Date
    Nov 2007
    Posts
    1

    Default How do I start - Any examples?

    I was looking through the documentation and there does not seem to be an example how to use Spring batch. Can you point me in the direction of an example?

    Cheers
    Tez

  2. #2

    Default

    When you checkout the source code you will see "samples" module. There are several example jobs which you can run as junit tests (see the package org.springframework.batch.sample under src/test/java)

  3. #3
    Join Date
    May 2007
    Posts
    4

    Default

    You can find a simple example in org.springframework.batch.sample.AbstractBatchLaun cherTests.

    Code less and config more.

    And it is said the interface JobLauncher will be removed soon(
    http://opensource.atlassian.com/proj...owse/BATCH-159)

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    JobLauncher is still there - probably will survive in 1.0 (I updated the JIRA issue comment to show this in case you aren't following the API).

  5. #5
    Join Date
    Dec 2007
    Posts
    3

    Default problem in starting Sample Batch Job

    Hello,

    I got problem while running sample project which i got from following location:

    http://s3browse.com/explore/maven.sp...batch-samples/

    The problem i am facing right now is how to run the sample project, i import the project in eclipse and put all dependent libraries and then run main file i.e. QuartzBatchLauncher. The configuration files related to sample project i.e. data-source.xml, simple-container-definition.xml and others files are loaded successfully, but i am not getting a starting point in order to run any sample job xml file.
    Now anyone can help me and guide how to start run any job file.
    I reckon the information related to spring-batch especially the samples are scattered.

  6. #6
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    There is a JIRA issue open for someone to create a Getting Started Guide, so please be patient on the documentation.

    You probably should checkout the samples source code from SVN because the best demos are all actually JUnit tests at the moment (in package org.springframework.batch.sample), and those are not in the s3 maven repo for m2. The main() method you found is not maintained - has no unit tests, so I'm not surprised if it doesn't work. It will probably be removed in a later milestone.

    M3 will be out later this week and will include a .zip download of all sources so you won't need to use SVN.

  7. #7
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    ...but following on from my last post - you don't *need* to checkout the test sources, but you have picked the wrong main() method. BatchCommandLineLauncher is a simple launcher that you can use to run any of the samples. It has pretty full Javadocs. But it isn't in the samples project (it's in execution).

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    Dave, some months ago I attended a session from Joris which had a nice example/case/tutorial for Spring batch. Maybe that presentation can be included in the Spring Batch build (or put on the website?).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •