luke.bace (66) [Avatar] Offline
Please post all Errors and Corrections to this thread. Thanks.
dfreitag (3) [Avatar] Offline
Re: Errors and Corrections
Call me picky, but you asked for errors and corrections. These are three that caught my eye at a first glance at the book, mainly dealing with singular and plural.

Page 11: Spring Batch follows the same path, even you’ll need to implement some
interfaces or extends some classes from the framework API.
Page 12: This support is about configuring resources easily (a DataSource for example)
but also about providing helper classes that provides more straightforward API or missing key features, like automatic conversion of SQLExceptions.
Page 60:
These persistent metadata also makes it possible to restart a failed job
exactly where it stopped. --> either This metadata or make (without trailing s).

Pickily yours
daniel smilie
MikeSmithson (10) [Avatar] Offline
Re: Errors and Corrections
Chapter 1, page 5 reads:
"This is not an ideal solution – the
user can be stuck (meaning you loose money!)"

should be:
"This is not an ideal solution – the
user can be stuck (meaning you lose money!)"
phillips1021 (66) [Avatar] Offline
Re: Errors and Corrections
The chapter 2 example code doesn't match the book. Additionally the chapter 2 example will not run because you have the Spring context xml files in the wrong place in the Maven folders.
tedyoung (12) [Avatar] Offline
Re: Errors and Corrections
Not an error/correction (because really, there are so many, just in the first chapter), more of a tone issue. In reading Ch. 1, the author sounds like he's trying to sell Spring Batch, e.g.:

"By providing a ready-to-use reader component, Spring Batch lets you focus your business code."


"Again, you won’t have to deal with technical code; your job will consist in [sic] some configuration, as shown in the following snippet:"


"This write example shows again that Spring Batch handles all the technical concerns. It provides any off-the-shelf components but is also flexible enough to let you plug on [sic] your own implementations."


"You see from table 1.2 that Spring Batch supports many technologies out-of-the-box, making it quite versatile."


"We’re sure that you’ve been happy to learn how Spring Batch can free you from cumbersome technical code like I/O handling to let you focus on the business code."

And I could go on. This kind of extraneous material makes it really hard for me to focus on the technical aspects of Spring Batch. I'm not sure if it's a language thing or a cultural thing, but it really rubs me the wrong way.

MikeSmithson (10) [Avatar] Offline
Re: Errors and Corrections
Honestly, there grammar in this EAP so horrifically bad that it would take way too much time to point them all out. I am pretty disappointed that the person doing the editing wasn't performing due diligence as they should have. This makes the reading of this title frustrating and difficult at best. I have to put this down regularly because of the horrible grammar.
SpringBatchGuyWannaBe (4) [Avatar] Offline
Re: Errors and Corrections
I just recently tried the hello world example in Chapter 1. It does work but I found that I had to download two more jar files in addition to the Spring and Spring Batch jars: 1. Commons logging (commons-logging-1.x.x.jar) and 2. The AOP Alliance jar (aopalliance-1.0.jar) once I loaded these jars the example worked as expected. But you may want to add the fact that you may need these additional jar files somewhere in this chapter or perhaps in the appendix.


Arnaud J (1) [Avatar] Offline
Re: Errors and Corrections
Page 18 (Ch1 - free version). "when something cause wrong" --> "goes" I guess.
BobSchoepf (1) [Avatar] Offline
Re: Errors and Corrections
You say:
"To be sure your properly named beans override the default beans, you have two options
(you can use one or the other, or both):
1. Declare your beans in files located in the /META-INF/spring/batch/override/ directory –
Spring Batch Admin ensures such files are loaded after the default files."

It should be /META-INF/spring/batch/servlet/override/ because batchadmin's servlet-config.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="" xmlnssmiliesi="" >

<import resource="classpath*:/META-INF/spring/batch/servlet/resources/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/manager/*.xml" />
<import resource="classpath*:/META-INF/spring/batch/servlet/override/*.xml" />

arnaud.cogoluegnes (73) [Avatar] Offline
Re: Errors and Corrections
Hi Bob,

thanks for pointing this out, but you the file you mention configures the DispatcherServlet's Spring application context. The appendix refers to the *root* application context, configured in this file:

This file does the following (so the appendix is correct):
<import resource="classpath*:/META-INF/spring/batch/override/**/*.xml" />

By dropping a file in /META-INF/spring/batch/override/, you can override the Spring Batch infrastructure (job launcher, task executor, etc.). Files in /META-INF/spring/batch/servlet/override/ are meant to override the UI.

Thanks for your interest in the book!

mrascher (1) [Avatar] Offline
Re: Errors and Corrections
At the end of 3.2.5 Configuring Transactions there is a statement that "If Spring catches a checked exceptions, a commit is executed" but in practice I'm not seeing records that were stored before the exception.

Also if that exception is added using the no-rollback-exception-classes to the tasklet configuration, the framework merely tries to invoke the task ad nauseum resulting in an endless loop.

arnaud.cogoluegnes (73) [Avatar] Offline
Re: Errors and Corrections

Spring Batch triggers a rollback on any exception. The sentence you quote is from a sidebar about *Spring's* declarative transaction management! So this is Spring's specific behavior. We should make this clearer, because it's confusing here.

Regarding the behavior you have with no-rollback-exception-classes, this isn't what I observe. This isn't really the place to speak about this, you should try the Spring Batch forum ( where you can post the whole configuration and describe the behavior you have. Perhaps you hit a bug, we never know.

thanks for your feedback!

chrislovecnm (1) [Avatar] Offline
Re: Errors and Corrections
Great job guys!

Correction in source example ..

A couple of source code / book mis-matches. Your book refers to org.springframework.batch.integration.chunk.ChunkProcessorChunkHandler pg 328

But the source code examples does not use it.

Questions / possible improvements:

The book does not explain what the purpose of the headerExtractor is ... pg 326
The book does not explain what the purpose of the pollerInterceptor
interceptor is ... pg 326

Also this is the comment in the source about the PollingSource:

A source for receiving JMS Messages with a polling listener. This source is
only recommended for very low message volume. Otherwise, the
{@link JmsMessageDrivenEndpoint} that uses Spring's MessageListener container
support is a better option.

Maybe use Endpoint??

I have tweaked that application context and pom.xml some, do you guys want a copy?
thierry.templier (16) [Avatar] Offline
Re: Errors and Corrections
Hello Chris,

Thanks very much for your feedback and your comments / improvements. I'll add that in the chapter...
Yes, I'm interested in your updated application context and pom.xml smilie

torchy (11) [Avatar] Offline
Re: Errors and Corrections
I have noticed the following minor errors (but haven't checked if others have)

p57 text refers to reader-transactional-queue but listing refers to is-reader-transactional-queue

p62 notation delimited by #{ and ] but perhaps should be #{ and }

p94 As soon as soon Spring Batch gets
torchy (11) [Avatar] Offline
Re: Errors and Corrections
p305 Listing 12.12

<property name="interceptorNames" value="exceptionTranslator" />

but exceptionTranslator isn't defined, I get this error running it

No bean named 'exceptionTranslator' is defined
thierry.templier (16) [Avatar] Offline
Re: Errors and Corrections

In fact, listing 12.12 describes only a part of the complete configuration focusing on the MBeanExporter bean. This bean indirectly uses the one you mentioned (bean with id exceptionTranslator). Here is the definition of this bean:

<bean id="exceptionTranslator" class="" />

For information, complete source code is available on googlecode at the following address:

sandman202 (4) [Avatar] Offline
Re: Errors and Corrections
On page 91, the sentence:

In Java, you cannot to stop code from executing immediately.

should say,

In Java, you cannot stop code from executing immediately.
reri (27) [Avatar] Offline
Re: Errors and Corrections
I received a note from reviewer Michał Minicki. He says that his name is spelled Micha Minicki. He said that if we can’t print the “ł”, we can just use “l” to spell Michal Minicki.
DiSch (1) [Avatar] Offline
Re: Errors and Corrections
Hello, on p13 there is Figure 1.8, a sequence diagram about chunk processing.

It shows the sequence
read() process() - read() process() - write()

Debugging here with Spring Batch 2.1.7 has not that behaviour but this one:
read() read() - process() process() - wite()

That's relevant because the isComplete()-check of the chunk completion policy hits after read(), not after process().
arnaud.cogoluegnes (73) [Avatar] Offline
Re: Errors and Corrections
Hi, Dish.

Fair enough. You're right, chunk processing is like the following: read, read, read, process, process, process, write.

This picture is wrong, but this isn't a "global" error of the book. Explanations in other places of the book (especially in the bulletproof chapter) builds on the correct sequence.

Thanks for pointing this out.