Errata


Print Print Icon

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



Version Location Description Submitted By
Safari Books Online 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 
Safari Books Online 2
whole chapter

The build.xml file for chapter 2 won't work, even when I download the examples and run directly from the examples folder.

Here's my output:

tobryan1@200-tobryan1-tip:~/Desktop/examples/ch02$ ant -v codegen
Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-6-sun-1.6.0.13/jre
Detected OS: Linux
parsing buildfile /home/tobryan1/Desktop/examples/ch02/build.xml with URI = file:/home/tobryan1/Desktop/examples/ch02/build.xml
Project base dir set to: /home/tobryan1/Desktop/examples/ch02
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
parsing buildfile jar:file:/opt/java/ant/lib/maven-ant-tasks-2.0.10.jar!/org/apache/maven/artifact/ant/antlib.xml with URI = jar:file:/opt/java/ant/lib/maven-ant-tasks-2.0.10.jar!/org/apache/maven/artifact/ant/antlib.xml
[artifact:dependencies] Loading Maven settings file: /home/tobryan1/.m2/settings.xml
[artifact:dependencies] Loading Maven settings file: /opt/java/maven/conf/settings.xml
[artifact:dependencies] Maven Ant Tasks version: 2.0.10
[artifact:dependencies] Using local repository: /opt/java/maven/repo
[artifact:dependencies] Resolving dependencies...
[artifact:dependencies] Using remote repositories:
- id=central, url=http://repo1.maven.org/maven2, releases=enabled, snapshots=disabled
- id=central, url=http://repo1.maven.org/maven2, releases=enabled, snapshots=disabled
org.apache.maven:super-pom:jar:2.0 (selected)
hsqldb:hsqldb:jar:1.8.0.7:compile (selected)
org.hibernate:hibernate:jar:3.2.5.ga:compile (selected)
net.sf.ehcache:ehcache:jar:1.2.3:compile (selected)
commons-logging:commons-logging:jar:1.0.4:compile (selected)
commons-collections:commons-collections:jar:2.1:compile (selected)
commons-logging:commons-logging:jar:1.0.4:compile (removed - nearer found: 1.0.4)
commons-logging:commons-logging:jar:1.0.4:compile (selected)
asm:asm-attrs:jar:1.5.3:compile (selected)
dom4j:dom4j:jar:1.6.1:compile (selected)
antlr:antlr:jar:2.7.6:compile (selected)
cglib:cglib:jar:2.1_3:compile (selected)
asm:asm:jar:1.5.3:compile (selected)
asm:asm:jar:1.5.3:compile (removed - nearer found: 1.5.3)
asm:asm:jar:1.5.3:compile (selected)
commons-collections:commons-collections:jar:2.1:compile (removed - nearer found: 2.1.1)
commons-collections:commons-collections:jar:2.1.1:compile (selected)
org.hibernate:hibernate-tools:jar:3.2.0.beta9a:compile (selected)
org.hibernate:hibernate:jar:3.2.0.cr5:compile (removed - nearer found: 3.2.5.ga)
freemarker:freemarker:jar:2.3.4:compile (selected)
org.hibernate:jtidy:jar:r8-20060801:compile (selected)
org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1:compile (selected)
log4j:log4j:jar:1.2.14:compile (selected)
Build sequence for target(s) `codegen' is [prepare, codegen]
Complete build sequence is [prepare, codegen, db, schema, ]

prepare:
[mkdir] Skipping /home/tobryan1/Desktop/examples/ch02/classes because it already exists.
[copy] com/oreilly/hh/data/Track.hbm.xml omitted as /home/tobryan1/Desktop/examples/ch02/classes/com/oreilly/hh/data/Track.hbm.xml is up to date.
[copy] hibernate.properties omitted as /home/tobryan1/Desktop/examples/ch02/classes/hibernate.properties is up to date.
[copy] log4j.properties omitted as /home/tobryan1/Desktop/examples/ch02/classes/log4j.properties is up to date.
[copy] No sources found.

codegen:

BUILD FAILED
java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.getMethods(Class.java:1410)
at org.apache.tools.ant.IntrospectionHelper.<init>(IntrospectionHelper.java:171)
at org.apache.tools.ant.IntrospectionHelper.getHelper(IntrospectionHelper.java:333)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:381)
at org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:349)
at org.apache.tools.ant.Task.maybeConfigure(Task.java:202)
at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:193)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.Configuration
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 22 more

Total time: 1 second

Has something about Ant changed or am I doing something wrong?

Todd O'Bryan 
Safari Books Online 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 
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 
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 
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 
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 
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 
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 
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 
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 
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 
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 


"This book is by far one of the best books on Hibernate. The main reason is the example code that go hand in hand with the book, and illustrates why Hibernate is so powerful. A decent clear example which simply solves the problem presented in each chapter is what every hard working developer needs from a book. Harnessing Hibernate delivers on this in spades."
--, Amazon.co.uk