Errata

Harnessing Hibernate

Errata for Harnessing Hibernate

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
unknown
Code sample

Example 13-3. Implementing the ArtistDAO interface.

The "doInHibernate(Session session)" method calls "getSession()" when it should just use the actual parameter "session".

Anonymous  Nov 16, 2008 
PDF Page michael_sweeney4@yahoo.com
michael_sweeney4@yahoo.com

p. 66
"It?s important to
let Hibernate know explicitly what?s going on by marking one end of the association
as inverse."

I didn't really get this, so I tried taking out the inverse="true"
and was able to generate tables and java source and insert rows OK.

Michael Sweeney  Mar 09, 2011 
4.1.1
example 4-1

in example class points to com.oreilly.hh.data.Track
This should read com.oreilly.hh.Track
(and with Artist table too)

This caused me about 2 hours of head scratching as the compiler throws up mapping exception

Anonymous  Jun 01, 2008 
PDF Page 5
Example 3-3

In Chapter 3 (Harnessing Hibernate) page 5 of my PDF copy:
Line 6 of CreateTest.java has the following import statement:
import com.oreilly.hh.data.*;
This throws up the javac error "package com.oreilly.hh.data does not exist"
That's right as the only thing in that class path is an xml file.

Other people must have reported this error, No? As soon as the import is commented out the code works ok.

Anonymous  May 30, 2008 
Other Digital Version 36
paragraph with number 2 on the left

I have this problem with ePub version of the book on the SONY PRS-600 Reader.
Paragraphs with numbers on the left side, have some text cropped on the right side. Thirst time it appear on pages 35-36 (paragraphs with numbers 1-2 on the left). But it seem that this problem related to all paragraphs with similar formating (with numbers on the left side).

Andrei L.  Jun 10, 2010 
Printed Page 47
Example 3-3

Line 6 of CreateTest.java has the following import statement:
import com.oreilly.hh.data.*;
This throws up the javac error "package com.oreilly.hh.data does not exist"
That's right as the only thing in that class path is an xml file.

Anonymous   
Printed Page 56
56

When I try to run QueryTest.java, I get the following error and read fails. Am I missing something here?

17:52:11,359 INFO Environment:514 - Hibernate 3.2.6
17:52:11,390 INFO Environment:547 - hibernate.properties not found
17:52:11,468 INFO Environment:681 - Bytecode provider name : cglib
17:52:11,515 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
17:52:11,640 INFO Configuration:1432 - configuring from resource: /hibernate.cfg.xml
17:52:11,640 INFO Configuration:1409 - Configuration resource: /hibernate.cfg.xml
17:52:11,781 INFO Configuration:559 - Reading mappings from resource : example/hh/model/Track.hbm.xml
17:52:11,937 INFO HbmBinder:300 - Mapping class: example.hh.model.Track -> TRACK
17:52:11,953 INFO Configuration:1547 - Configured SessionFactory:
17:52:12,140 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
17:52:12,140 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
17:52:12,140 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
17:52:12,187 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/music
17:52:12,187 INFO DriverManagerConnectionProvider:86 - connection properties: {user=root, password=****, shutdown=true}
17:52:12,734 INFO SettingsFactory:89 - RDBMS: MySQL, version: 5.0.24a-community-nt
17:52:12,734 INFO SettingsFactory:90 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
17:52:12,781 INFO Dialect:152 - Using dialect: org.hibernate.dialect.MySQL5Dialect
17:52:12,781 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
17:52:12,781 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
17:52:12,781 INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
17:52:12,781 INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
17:52:12,781 INFO SettingsFactory:154 - JDBC batch size: 15
17:52:12,812 INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
17:52:12,812 INFO SettingsFactory:162 - Scrollable result sets: enabled
17:52:12,812 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): enabled
17:52:12,812 INFO SettingsFactory:178 - Connection release mode: auto
17:52:12,828 INFO SettingsFactory:202 - Maximum outer join fetch depth: 2
17:52:12,828 INFO SettingsFactory:205 - Default batch fetch size: 1
17:52:12,828 INFO SettingsFactory:209 - Generate SQL with comments: disabled
17:52:12,828 INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
17:52:12,828 INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
17:52:12,828 INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
17:52:12,843 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
17:52:12,843 INFO SettingsFactory:225 - Query language substitutions: {}
17:52:12,843 INFO SettingsFactory:230 - JPA-QL strict compliance: disabled
17:52:12,843 INFO SettingsFactory:235 - Second-level cache: enabled
17:52:12,843 INFO SettingsFactory:239 - Query cache: disabled
17:52:12,843 INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
17:52:12,843 INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
17:52:12,843 INFO SettingsFactory:263 - Structured second-level cache entries: disabled
17:52:12,859 INFO SettingsFactory:283 - Echoing all SQL to stdout
17:52:12,859 INFO SettingsFactory:290 - Statistics: disabled
17:52:12,859 INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
17:52:12,859 INFO SettingsFactory:309 - Default entity-mode: pojo
17:52:12,859 INFO SettingsFactory:313 - Named query checking : enabled
17:52:12,921 INFO SessionFactoryImpl:161 - building session factory
17:52:13,437 INFO SessionFactoryObjectFactory:86 - Factory name:
17:52:13,437 INFO NamingHelper:26 - JNDI InitialContext properties:{}
17:52:13,437 WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.getNameParser(InitialContext.java:480)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at example.hh.test.QueryTest.main(QueryTest.java:31)
17:52:13,453 INFO SchemaExport:154 - Running hbm2ddl schema export
17:52:13,453 DEBUG SchemaExport:170 - import file not found: /import.sql
17:52:13,453 INFO SchemaExport:179 - exporting generated schema to database
17:52:13,453 DEBUG SchemaExport:303 - drop table if exists TRACK
17:52:13,531 DEBUG SchemaExport:303 - create table TRACK (TRACK_ID integer not null auto_increment, title varchar(255) not null, filePath varchar(255) not null, playTime time, added date, volume smallint not null, primary key (TRACK_ID))
17:52:13,609 INFO SchemaExport:196 - schema export complete
Hibernate: select track0_.TRACK_ID as TRACK1_0_, track0_.title as title0_, track0_.filePath as filePath0_, track0_.playTime as playTime0_, track0_.added as added0_, track0_.volume as volume0_ from TRACK track0_ where track0_.playTime<=?
17:52:14,203 INFO SessionFactoryImpl:769 - closing
17:52:14,203 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:mysql://localhost/music
17:52:14,218 INFO SessionFactoryObjectFactory:112 - Unbinding factory from JNDI name:
17:52:14,218 INFO NamingHelper:26 - JNDI InitialContext properties:{}
17:52:14,218 WARN SessionFactoryObjectFactory:123 - Could not unbind factory from JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.unbind(InitialContext.java:416)
at org.hibernate.impl.SessionFactoryObjectFactory.removeInstance(SessionFactoryObjectFactory.java:116)
at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:806)
at example.hh.test.QueryTest.main(QueryTest.java:52)

Anonymous   
Printed Page 64
section 4.1.1, example 4-1

in example class points to com.oreilly.hh.data.Track
This should read com.oreilly.hh.Track
(and with Artist table too)

Anonymous   
Printed Page 75
example 4-9

Going through the example in Chapter 4, the Track.hbm.xml defines <property name="playTime" type="time">

The generated code for the Track class shows the corresponding field to be of type Date. The CreateTest.java example however is using a Time value in the constuctor, e.g.

Track track = new Track("Russian Trance",
"vol2/album610/track02.mp3",
Time.valueOf("00:03:30"),
new HashSet<Artist>(),
new Date(), (short)0, new HashSet<String>());

Did I misunderstand or is there a problem here?

Anonymous   
PDF Page 81
michael_sweeney4@yahoo.com

Just an observation about QueryTest2. I put a session.beginTransaction() and changed the of 2nd argument of getArtist() to true, then typed in an artist name and it inserted an artist for every key stroke.
Yes I did remember to close the transaction.

Michael Sweeney  Mar 10, 2011 
Printed Page 85
4th non-code paragraph

On page 85, 4th non-code paragraph: "Rebuilding the databases with 'ant schema' shows how this gets built in the database." does not work.

I ran 'ant schema' and got an error message about TRACK_COMMENTS

This step of the chapter four (4) example only worked when I preceded 'ant schema' with 'ant prepare'.

George Girton  Jul 26, 2009 
Printed Page 88
Example 5-1

"Example 5-1. Eagerly initializing the track artist associations" changes the key column name from TRACK_ID to TRACK for the TRACK_ARTISTS set. Earlier in the text it appears as TRACK_ID, but this is just a snippet and not a restatement of the Track class xml mapping.

Anonymous   
Printed Page 92
Example 5-4

class name reads: name="com.oreilly.hh.data.Album"
Should read "com.oreilly.hh.Album" to be consistent with the classes

Anonymous   
Printed Page 95
On Figure 5-1 of section 5.3

Right hand Entity ALBUM_TRACKS should read "TRACK"

Anonymous   
PDF Page 99
michael_sweeney4@yahoo.com

I'm puzzling over:
"... notice that one of those columns (ALBUM_ID and LIST_POS)
is a property of the AlbumTrack class while the other is not"

I see ALBUM_TRACKS has both columns ALBUM_ID and LIST_POS, but the AlbumTracks has only these "properties":

private Track track;
private Integer disc;
private Integer positionOnDisc;

Michael Sweeney  Mar 10, 2011 
Printed Page 106
Example 5-13

5-13 shows (in bold) the changes we'd make to the tracks property mapping in Album.hbm.xml.

Each example (throughout the book) where the words "in bold" are shown the accompanying example does not have any embolden lines.

Anonymous   
PDF Page 125
michael_sweeney4@yahoo.com

"Note that if we hadn?t decided to do our own fancy formatting of a subset of the tracks?
properties in QueryTest and instead relied on the toString( ) method in Track, we would
not have needed to make any changes to QueryTest to see this new information..."

Not sure what "fancy formatting in QueryTest" refers to.

Michael Sweeney  Mar 12, 2011 
Printed Page 148
middle of Example 7-6

It looks to me as if the join columns are switched in the annotations examples in Ch 7, 12. The populated TRACK_ARTISTS table seems to have values for TRACK_ID and ARTIST_ID swapped. The xml mapping example in Ch 4 works OK.

Can you please confirm that the following are supposed to be equivilent?

<set name="artists" table="TRACK_ARTISTS">
<key column="TRACK_ID"/>
<many-to-many class="com.oreilly.hh.data.Artist" column="ARTIST_ID"/>
</set>


@ManyToMany
@JoinTable(name="TRACK_ARTISTS",
joinColumns={@JoinColumn(name="ARTIST_ID")},
inverseJoinColumns={@JoinColumn(name="TRACK_ID")})
private Set<Artist> artists;

Thanks!

Anonymous  Nov 09, 2008 
Printed Page 148
middle of page

This error has already been reported but has not been shifted to the confirmed errata: swap of ARTIST_ID & TRACK_ID in JoinTable. This error goes down into the code that can be downloaded. This should be confirmed so readers can save time debugging themselves (and not reading unconfirmed errata).

Anonymous  Aug 21, 2009 
Printed Page 201
java.lang.UnsupportedClassVersionError: Bad version number in .class file

This exception occurs in Chapter 10, after trying to run ant schema, which depends on target codegen. The error occurs in target codegen.

I'm using Java version 1.0.6.0_03, which has worked for all previous chapters.

TRACE

codegen:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 21:33:44,187 ERROR runtime:96 -
[hibernatetool] Method public java.lang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeName(org.hibernate.mapping.Property,boolean) th
rew an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.oreilly.hh.data.Track)
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> ${pojo.getJavaTypeName(field, jdk5)} [on line 6, column 45 in pojo/PojoFields.ftl]
[hibernatetool] in include "PojoFields.ftl" [on line 8, column 1 in pojo/Pojo.ftl]
[hibernatetool] ----------

[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeNam
e(org.hibernate.mapping.Property,boolean) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.oreilly.hh.data.Track)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
[hibernatetool] at freemarker.core.Expression.getStringValue(Expression.java:93)
[hibernatetool] at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:351)
[hibernatetool] at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.include(Environment.java:1375)
[hibernatetool] at freemarker.core.Include.accept(Include.java:155)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.IfBlock.accept(IfBlock.java:82)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:233)
[hibernatetool] at freemarker.core.BlockAssignment.accept(BlockAssignment.java:83)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:196)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:176)
[hibernatetool] at freemarker.template.Template.process(Template.java:231)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelper.java:247)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.java:146)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(GenericExporter.java:135)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter$2.process(GenericExporter.java:41)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java:126)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java:95)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[hibernatetool] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[hibernatetool] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[hibernatetool] Caused by: java.lang.reflect.InvocationTargetException
[hibernatetool] at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:585)
[hibernatetool] at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:583)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
[hibernatetool] ... 54 more
[hibernatetool] Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file
[hibernatetool] at java.lang.ClassLoader.defineClass1(Native Method)
[hibernatetool] at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
[hibernatetool] at org.apache.tools.ant.loader.AntClassLoader2.defineClassFromData(AntClassLoader2.java:76)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1090)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1154)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1107)
[hibernatetool] at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:977)
[hibernatetool] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[hibernatetool] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[hibernatetool] at java.lang.Class.forName0(Native Method)
[hibernatetool] at java.lang.Class.forName(Class.java:164)
[hibernatetool] at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
[hibernatetool] at org.hibernate.type.TypeFactory.heuristicType(TypeFactory.java:223)
[hibernatetool] at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:260)
[hibernatetool] at org.hibernate.tool.hbm2x.visitor.JavaTypeFromValueVisitor.handle(JavaTypeFromValueVisitor.java:62)
[hibernatetool] at org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor.accept(DefaultValueVisitor.java:92)
[hibernatetool] at org.hibernate.mapping.SimpleValue.accept(SimpleValue.java:297)
[hibernatetool] at org.hibernate.tool.hbm2x.Cfg2JavaTool.getJavaTypeName(Cfg2JavaTool.java:298)
[hibernatetool] at org.hibernate.tool.hbm2x.Cfg2JavaTool.getRawTypeName(Cfg2JavaTool.java:265)
[hibernatetool] at org.hibernate.tool.hbm2x.Cfg2JavaTool.getJavaTypeName(Cfg2JavaTool.java:180)
[hibernatetool] at org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeName(BasicPOJOClass.java:839)
[hibernatetool] ... 59 more
[hibernatetool] An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo/Pojo.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getJavaTypeNam
e(org.hibernate.mapping.Property,boolean) threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.oreilly.hh.data.Track)
[hibernatetool] java.lang.reflect.InvocationTargetException
[hibernatetool] java.lang.UnsupportedClassVersionError: Bad version number in .class file
[hibernatetool] You are most likely running the ant task with a JRE that is older than the JRE required to use the classes.
[hibernatetool] e.g. running with JRE 1.3 or 1.4 when using JDK 1.5 annotations is not possible.
[hibernatetool] Ensure that you are using a correct JRE.

Irritant  Jan 22, 2009 
Printed Page 211
Figure 11-3

These instructions won't work for Eclipse 3.4.2. You need to go to http://www.jboss.org/community/docs/DOC-10044 and follow the instructions in the Installing JBoss Tools from the Update Site section.

kxen  Mar 10, 2009 
Printed Page 282
diagram

artistDAO should be connected to createTest and albumTest on the left;
albumDAO should only be connected to albumTest on the left.

Another problem with those Spring diagrams in general is you can't tell which end of the connection is wired to which.

Anonymous   
Printed Page 282
diagram

artistDAO should be connected to createTest and albumTest on the left;
albumDAO should only be connected to albumTest on the left.

Another problem with those Spring diagrams in general is you can't tell which end of the connection is wired to which.

Anonymous  Jun 02, 2008 
PDF Page 282
United States

When I run this example, the ArtistDAO and TrackDAO (e.g. in CreateTest.java) never get set.
I wonder if its because the class of your sessionFactory in applicationContext is org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean, whereas HibernateDaoSupport (which your DAOs extend) is expecting an org.hibernate.SessionFactory (which is not a superclass of AnnotationSessionFactoryBean.

Michaael Sweeney  Mar 15, 2012 
PDF Page 301
michael_sweeney4@yahoo.com

#3 should say "The catalina-ant artifact", not "artifactId"

Mike Sweeney  Feb 19, 2011 
PDF Page 312
edit() method

The pdf book has:
*******************
public Resolution edit() {
if(album != null) {
album = albumDAO.get(album.getId());
}
return new ForwardResolution("/albums/edit.jsp");
}
******************************
In the download, it looks like:
******************************
@LoadBean("album")
public Resolution edit() {
log.debug("Editing album: " + album);
return new ForwardResolution("/albums/edit.jsp");
}

Mike Sweeney  Feb 19, 2011 
Printed Page 352
3rd paragraph

Chapter 13 Put a Spring in your Step: Hibernate with Spring

Writing a Data Access Object

The Stripes API provides a silmpe way to tolerlate such... ...

==&#12297;The Spring API provides a silmpe way to tolerlate such... ...

Note from the Author or Editor:
I can?t find the location of this problem. I can imagine we need to replace a ?Stripes? with a ?Spring? but in my printed copy of the book, page 352 is in the index, not Chapter 13.

azzu9ri  Jan 26, 2010