Results 1 to 10 of 15

Thread: Batch version compatible with Spring 2.0

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Posts
    20

    Default Batch version compatible with Spring 2.0

    Hi all,

    I am looking to integrate some batch processing into a web app, and being as I already have experience with Spring Batch, I thought this would be the best way to go.

    However, our web app is running on version 2.0 of Spring, and upgrading it is a bigger job than we can justify at the moment.

    Would anyone be able to advise me as to the version of Spring Batch I should be using.
    I've tried 2.1.8 but am having numerous issues with namespaces and method not found errors.

    Many thanks for your time,

    Dave

  2. #2
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    Spring Batch was built on Spring 2.5 and has always required that as the minimum version for Spring (in fact, we'll be updating it to require Spring 3+ soon). When you say "upgrading it is a bigger job than we can justify at the moment", two things come to mind:

    1. Did you evaluate the upgrade based on going all the way to the current version or just to 2.5?
    2. Is the use of Spring Batch enough of a justification to do the upgrade to at least 2.5?
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  3. #3
    Join Date
    Mar 2010
    Posts
    20

    Default

    Quote Originally Posted by mminella View Post
    Spring Batch was built on Spring 2.5 and has always required that as the minimum version for Spring (in fact, we'll be updating it to require Spring 3+ soon). When you say "upgrading it is a bigger job than we can justify at the moment", two things come to mind:

    1. Did you evaluate the upgrade based on going all the way to the current version or just to 2.5?
    2. Is the use of Spring Batch enough of a justification to do the upgrade to at least 2.5?
    Hi,

    Many thanks for the reply.

    1 - I've looked at upgrading to the current version, as I wasn't sure at what point Spring Batch 2.1.8 became available.
    2 - It probably is to be honest. Now I know that's the minimum version, I can at least try it and see what breaks in our code.

    Just to mention, my concern isn't around Spring, it's more to do with the current state of our code

  4. #4
    Join Date
    Mar 2010
    Posts
    20

    Default

    Hi mminella (or anyone else reading),

    I've upgraded Spring to 2.5, and nothing seems to have broken. Happy days indeed.

    However, when I've tried to implement a FlatFileItemReader (as below), I get the following error:

    Code:
    2012-10-04 08:58:03,242 ERROR core.step.AbstractStep:213  -> Encountered an error executing the step: class java.lang.NoSuchMethodError: org.springframework.core.io.Resource.isReadable()Z
    Code:
        <bean id="itemReader" class="org.springframework.batch.item.file.FlatFileItemReader" >
            <property name="resource" value="file:C:/DJames/Batch/test_input.csv" />
            <property name="lineMapper" ref="lineMapper"/>
        </bean>
    I've got the Spring.jar on my classpath (as provided with 2.5), and the Spring core jar on there too, both of which have a Resource class without the "isReadable" method.

    Is the "isReadable" method a new dependency in a version of Spring Batch that isn't backwardly compatible with Spring 2.5?

  5. #5
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    351

    Default

    What version of Spring Batch are you trying to use? While upgrading to 2.5 will get you onto Spring Batch in general, the latest code. I did some digging and it looks like that method call was introduced on the 2.1 branch so if you stick with a version of the 2.0 branch, you should be fine with Spring 2.5 (in theory).

    I have to ask though, if you did the bump to 2.5, have you tried spring 3?
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  6. #6
    Join Date
    Mar 2010
    Posts
    20

    Default

    Thanks again for your help.

    I'll need to discuss what versions of both Spring and Spring Batch we will go to, as it's not purely my decision.
    I do need to do a bit more digging to find out what effect (if any), moving to Spring 3 would have. I have a horrible feeling that some of the stuff that's deprecated is still in use with our code (from memory, things like the specific MVC controller classes).

    At least I have a plan of action now, which is more than I had this morning, so thanks for that.

Posting Permissions

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