Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Batch version compatible with Spring 2.0

  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
    343

    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
    343

    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.

  7. #7
    Join Date
    Mar 2010
    Posts
    20

    Default

    Hi again everyone.

    I've got batch working within our webapp now, so thanks for all your help.

    The next step is to get Spring Batch Admin running to monitor job execution, and needless to say, I'm having some issues.
    I can include the three jars on the classpath, and I can build and run my app.

    From looking at the docs I've seen, I should be able to go to
    Code:
    <my webapp root>/batch
    and see the standard Spring Batch Admin screen. Is this correct?
    If it is correct, then I've done something wrong, as I just get a 404.

    I've then tried to explicitly override the servlet settings (as described variously all over the web) to map the root to
    Code:
    /batch
    and that throws me another unexpected error:
    Code:
    Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/http]

    Really at my wit's end now, can anyone help?

    Currently using:
    Spring - 2.5.6
    Spring Batch - 2.0.4

  8. #8
    Join Date
    Mar 2010
    Posts
    20

    Default

    Hi again,

    Resolved that issue, to be faced with a new one.
    Previous issue was solved by adding the spring integration http and core jars.

    Getting further issues with beans undefined. I'll try and work through them.

    Using Spring Integration release 1.0.4 - anyone know any reasons why that wouldn't work well with the batch and batch admin versions I've mentioned above?

  9. #9
    Join Date
    Sep 2008
    Location
    Chicagoland, IL
    Posts
    343

    Default

    What version of admin are you trying to run and getting errors with?
    Michael Minella
    Spring Batch Lead
    Author - Pro Spring Batch
    http://www.michaelminella.com
    Twitter: @MichaelMinella

  10. #10
    Join Date
    Mar 2010
    Posts
    20

    Default

    Quote Originally Posted by mminella View Post
    What version of admin are you trying to run and getting errors with?
    Version 1.0.0 (I think - not at work at the moment).

    From what I can remember of the stack trace, the main issue was an error when initialising the context, specifically around the TransformerBeanDefinition, and an error in finding a multipart-job-requests bean.

    Will post more accurate stack trace details tomorrow.

    Am I correct in my assumption that just by including the Spring batch Admin jars (and dependants) on the classpath, and by setting a servlet mapping, I should be able to see the default admin home screen in my own web app?

Posting Permissions

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