The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Just got your book. Trying to work out the sample in Chapter 2 - Hello world. After spending all day fixing various errors finally stuck at this one. Can you help?


[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Using dialect: org.hibernate.dialect.HSQLDialect
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Running hbm2ddl schema export
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: writing generated schema to file: F:personalhibernatestu
dyhellowworldhelloworld-ddl.sql
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: exporting generated schema to database
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Using Hibernate built-in connection pool (not for producti
on use!)
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Hibernate connection pool size: 20
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: autocommit mode: false
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hs
ql://localhost
[hibernatetool] May 24, 2010 3:01:31 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: connection properties: {user=sa}
[hibernatetool]
[hibernatetool] alter table MESSAGES
[hibernatetool] drop constraint FK_NEXT_MESSAGE;
[hibernatetool]
[hibernatetool] drop table MESSAGES if exists;
[hibernatetool]
[hibernatetool] create table MESSAGES (
[hibernatetool] MESSAGE_ID bigint generated by default as identity (star
t with 1),
[hibernatetool] MESSAGE_TEXT varchar(255),
[hibernatetool] NEXT_MESSAGE_ID bigint,
[hibernatetool] primary key (MESSAGE_ID)
[hibernatetool] );
[hibernatetool]
[hibernatetool] alter table MESSAGES
[hibernatetool] add constraint FK_NEXT_MESSAGE
[hibernatetool] foreign key (NEXT_MESSAGE_ID)
[hibernatetool] references MESSAGES;
[hibernatetool] May 24, 2010 3:01:32 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: schema export complete
[hibernatetool] May 24, 2010 3:01:32 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: cleaning up connection pool: jdbc:hsqldb:hsql://localhost
[hibernatetool] 1 errors occurred while performing <hbm2ddl>.
[hibernatetool] Error #1: java.sql.SQLException: user lacks privilege or object
not found: MESSAGES

BUILD SUCCESSFUL
Total time: 2 seconds
F:personalhibernatestudyhellowworld>Ant schemaexport
Buildfile: F:personalhibernatestudyhellowworlduild.xml

compile:
[javac] F:personalhibernatestudyhellowworlduild.xml:39: warning: 'inclu
deantruntime' was not set, defaulting to build.sysclasspath=last; set to false f
or repeatable builds

copymetafiles:
[copy] Copying 1 file to F:personalhibernatestudyhellowworlduild

schemaexport:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] May 24, 2010 3:03:43 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Hibernate 3.5.2-Final
[hibernatetool] May 24, 2010 3:03:43 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] May 24, 2010 3:03:43 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Bytecode provider name : javassist
[hibernatetool] May 24, 2010 3:03:43 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: configuring from file: hibernate.cfg.xml
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Reading mappings from resource : hello/Message.hbm.xml
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Mapping class: hello.Message -> MESSAGES
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Configured SessionFactory: null
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Using dialect: org.hibernate.dialect.HSQLDialect
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Running hbm2ddl schema export
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: writing generated schema to file: F:personalhibernatestu
dyhellowworldhelloworld-ddl.sql
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: exporting generated schema to database
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Using Hibernate built-in connection pool (not for producti
on use!)
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: Hibernate connection pool size: 20
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: autocommit mode: false
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hs
ql://localhost
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: connection properties: {user=SA}
[hibernatetool]
[hibernatetool] alter table MESSAGES
[hibernatetool] drop constraint FK_NEXT_MESSAGE;
[hibernatetool]
[hibernatetool] drop table MESSAGES if exists;
[hibernatetool]
[hibernatetool] create table MESSAGES (
[hibernatetool] MESSAGE_ID bigint generated by default as identity (star
t with 1),
[hibernatetool] MESSAGE_TEXT varchar(255),
[hibernatetool] NEXT_MESSAGE_ID bigint,
[hibernatetool] primary key (MESSAGE_ID)
[hibernatetool] );
[hibernatetool]
[hibernatetool] alter table MESSAGES
[hibernatetool] add constraint FK_NEXT_MESSAGE
[hibernatetool] foreign key (NEXT_MESSAGE_ID)
[hibernatetool] references MESSAGES;
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: schema export complete
[hibernatetool] May 24, 2010 3:03:44 PM org.slf4j.impl.JCLLoggerAdapter info
[hibernatetool] INFO: cleaning up connection pool: jdbc:hsqldb:hsql://localhost

BUILD SUCCESSFUL
Total time: 1 second
F:personalhibernatestudyhellowworld>Ant run
Buildfile: F:personalhibernatestudyhellowworlduild.xml

compile:
[javac] F:personalhibernatestudyhellowworlduild.xml:39: warning: 'inclu
deantruntime' was not set, defaulting to build.sysclasspath=last; set to false f
or repeatable builds

copymetafiles:

run:
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Hibernate 3.5.2-Final
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: hibernate.properties not found
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Bytecode provider name : javassist
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: using JDK 1.4 java.sql.Timestamp handling
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: configuring from resource: /hibernate.cfg.xml
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Configuration resource: /hibernate.cfg.xml
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Reading mappings from resource : hello/Message.hbm.xml
[java] May 24, 2010 3:06:30 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Mapping class: hello.Message -> MESSAGES
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Configured SessionFactory: null
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Using Hibernate built-in connection pool (not for production u
se!)
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Hibernate connection pool size: 20
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: autocommit mode: false
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql:/
/localhost
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: connection properties: {user=SA}
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: RDBMS: HSQL Database Engine, version: 2.0.0
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: JDBC driver: HSQL Database Engine Driver, version: 2.0.0
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Using dialect: org.hibernate.dialect.HSQLDialect
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Using default transaction strategy (direct JDBC transactions)
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: No TransactionManagerLookup configured (in JTA environment, us
e of read-write or transactional second-level cache is not recommended)
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Automatic flush during beforeCompletion(): disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Automatic session close at end of transaction: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: JDBC batch size: 15
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: JDBC batch updates for versioned data: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Scrollable result sets: enabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: JDBC3 getGeneratedKeys(): enabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Connection release mode: auto
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Default batch fetch size: 1
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Generate SQL with comments: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Order SQL updates by primary key: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Order SQL inserts for batching: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFact
ory
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Using ASTQueryTranslatorFactory
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Query language substitutions: {}
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: JPA-QL strict compliance: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Second-level cache: enabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Query cache: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegio
nFactory
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Optimize cache for minimal puts: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Structured second-level cache entries: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Statistics: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Deleted entity synthetic identifier rollback: disabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Default entity-mode: pojo
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Named query checking : enabled
[java] May 24, 2010 3:06:31 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: Check Nullability in Core (should be disabled when Bean Valida
tion is on): enabled
[java] May 24, 2010 3:06:32 PM org.slf4j.impl.JCLLoggerAdapter info
[java] INFO: building session factory
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at persistence.HibernateUtil.<clinit>(Unknown Source)
[java] at hello.HelloWorld.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: Unable to instantiate d
efault tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
[java] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTup
lizer(EntityTuplizerFactory.java:110)
[java] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDef
aultTuplizer(EntityTuplizerFactory.java:135)
[java] at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.
<init>(EntityEntityModeToTuplizerMapping.java:80)
[java] at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetam
odel.java:323)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.<init>
(AbstractEntityPersister.java:475)
[java] at org.hibernate.persister.entity.SingleTableEntityPersister.<in >
it>(SingleTableEntityPersister.java:133)
[java] at org.hibernate.persister.PersisterFactory.createClassPersister
(PersisterFactory.java:84)
[java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryIm
pl.java:295)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configura
tion.java:1385)
[java] ... 2 more
[java] Caused by: java.lang.reflect.InvocationTargetException
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
[java] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeC
onstructorAccessorImpl.java:39)
[java] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Del
egatingConstructorAccessorImpl.java:27)
[java] at java.lang.reflect.Constructor.newInstance(Constructor.java:51
3)
[java] at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTup
lizer(EntityTuplizerFactory.java:107)
[java] ... 10 more
[java] Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/Meth
odFilter
[java] at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProx
yFactoryFactory(BytecodeProviderImpl.java:49)
[java] at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFacto
ryInternal(PojoEntityTuplizer.java:207)
[java] at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFacto
ry(PojoEntityTuplizer.java:185)
[java] at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(Abst
ractEntityTuplizer.java:170)
[java] at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEnti
tyTuplizer.java:77)
[java] ... 15 more
[java] Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.Me
thodFilter
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:18smilie
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[java] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

[java] ... 20 more
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 3 seconds
F:personalhibernatestudyhellowworld>Ant run