Errata

Spring: A Developer's Notebook

Errata for Spring: A Developer's Notebook

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 2,4,8
middle, lower third, lower third

p. 2: All of the classes shown in the book reside in a single package,
com.springbook, unless otherwise specified.
p. 8: Run the application like this: java RentABikeAssembler

Either the first or the second statement is wrong. If RentABikeAssember is part of
the com.springbook package, then the application needs to be run with the package
name
java com.springbook.RentABikeAssembler
or, if the classes are assumed to be in the default package, then the first statement
is clearly wrong. Just pulling the assembler class out from com.springbook and
putting it into the default package will not work as it references the RentABike
interface which is package-private.

Same for p. 4 "Run the application like this: java CommandLineView"

Anonymous   
Printed Page 7
Example 1-5

You need to add a method to the interface:

String getStoreName();

or else the test case on page 15 will not compile.

Anonymous   
Printed Page 9
2nd paragraph

The dependency injection strategy lets you pick a consistent approach...
-->
The dependency lookup strategy lets you pick a consistent approach...

Anonymous   
Printed Page 11,12
Example 1-8 (bottom), its output when run

The build file specifies the class directory as war/classes, the output indicates
it's actually war/WEB-INF/classes.

Anonymous   
Printed Page 13
last para

The Para "What Just Happened?" Suggests the author will explain Spring IOC: "let's
talk about what's happening under the covers".

But on turning the page the topic changes. And we are left with no exploration of
this subject.

Anonymous   
Printed Page 14
Example 1-9

<bean id="rentaBike" class="ArrayListRentABike">
<property name="storeName"><value>"Bruce's Bikes</value></property>
</bean>

This should read:

<bean id="rentaBike" class="ArrayListRentABike">
<constructor-arg><value>Bruce's Bikes<value></constructor-arg>
</bean>

Anonymous   
Printed Page 15
Example 1-11

The method testGetName() in exampel 1-11
requires the getStoreName() method in both Example 1-4 and
Example 1-5 on page 7.

Anonymous   
Printed Page 16
Example 1-12

In order to run the build.xml in Example 1-12 one must add the paramenter

classpathref="bikestore.class.path"

to the compile target as shown in example 1-8.

Anonymous   
Printed Page 17
Example 1-13

The fourth line should read:
<include name="*/*Test.*" />

Anonymous   
Printed Page 20
Example 2-12

Spring will throw an error which says:
java.lang.IllegalStateException: Bean definition does not carry a resolved bean class

The reason is that there is no class defined:
<bean id="urlMapping"
<property name="mappings">
<props>
<prop key="/bikes.bikes">bikesController</prop>
<prop key="/editBike.bikes">editBikeController</prop>
<prop key="/newBike.bikes">editBikeController</prop>
<prop key="/submitBike.bikes">submitBikeController</prop>
</props>
</property>
</bean>

Change it to
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/bikes.bikes">bikesController</prop>
<prop key="/editBike.bikes">editBikeController</prop>
<prop key="/newBike.bikes">editBikeController</prop>
<prop key="/submitBike.bikes">submitBikeController</prop>
</props>
</property>
</bean>

Without the SimpleUrlHandlerMapping, error will be thrown!

Anonymous   
Printed Page 22
example 2-6

It's missing a closing </a> tag.

Anonymous   
Printed Page 27
2nd paragraph

The build.xml in the sample code archive uses
the context path "/rentabike". So, URL should
follow it.

(for example, http://localhost:8080/bikes.bikes)
-->
(for example, http://localhost:8080/rentabike/bikes.bikes)

The URL in Fig 2-2 should also be this URL.

Anonymous   
Printed Page 91
Example 5-11

You need to set the value of unsaved-value for the Bike.hbm.xml mapping file to 0,
since when a new Bike is created, the value of the int field bikeId is equal to 0.
Either that, or change the value of the bikeId field for a new Bike to -1. I tried
both approaches, and they worked. But the way the example is written in the book,
and in the source code, it will bomb when you try to add a new bike.

Anonymous   
Printed Page 110
First paragraph, Last sentence

The sentence is "Recall that you've got to do three things" but the following list
has four items. However, the example 6-5 only seems to have three things (1, 3, and
4) from the list. The list on pg 110 applies to the example on pg 113.

Anonymous