Tenwit,
Pardon the absence. Here is the exception I get with the above configuration.
Thank you,
Ty
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>cd C:\_HibernateHelloWorld\HelloWorldHibernate
C:\_HibernateHelloWorld\HelloWorldHibernate>ant run
Buildfile: build.xml
clean:
[delete] Deleting directory C:\_HibernateHelloWorld\HelloWorldHibernate\bin
[mkdir] Created dir: C:\_HibernateHelloWorld\HelloWorldHibernate\bin
copy-resources:
[copy] Copying 6 files to C:\_HibernateHelloWorld\HelloWorldHibernate\bin
[copy] Copied 4 empty directories to 2 empty directories under C:\_HibernateHelloWorld\HelloWorldHibernate\bin
compile:
[javac] Compiling 7 source files to C:\_HibernateHelloWorld\HelloWorldHibernate\bin
[javac] Note: C:\_HibernateHelloWorld\HelloWorldHibernate\src\events\EventManager.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
run:
[java] In 'getPerson'
[java] 15:49:07,735 INFO Environment:474 - Hibernate 3.1
[java] 15:49:07,735 INFO Environment:504 - hibernate.properties not found
[java] 15:49:07,745 INFO Environment:520 - using CGLIB reflection optimizer
[java] 15:49:07,745 INFO Environment:550 - using JDK 1.4 java.sql.Timestamp handling
[java] 15:49:07,815 INFO Configuration:1257 - configuring from resource: /hibernate.cfg.xml
[java] 15:49:07,815 INFO Configuration:1234 - Configuration resource: /hibernate.cfg.xml
[java] 15:49:07,935 INFO Configuration:460 - Reading mappings from resource: events/Event.hbm.xml
[java] 15:49:08,076 INFO HbmBinder:266 - Mapping class: events.Event -> EVENT
[java] 15:49:08,106 INFO Configuration:460 - Reading mappings from resource: events/Person.hbm.xml
[java] 15:49:08,156 INFO HbmBinder:266 - Mapping class: events.Person -> PERSON
[java] 15:49:08,156 INFO Configuration:460 - Reading mappings from resource: events/Attendees.hbm.xml
[java] 15:49:08,206 INFO HbmBinder:266 - Mapping class: events.Attendees -> ATTENDEE
[java] 15:49:08,236 INFO Configuration:1368 - Configured SessionFactory: null
[java] 15:49:08,236 INFO Configuration:1014 - processing extends queue
[java] 15:49:08,236 INFO Configuration:1018 - processing collection mappings
[java] 15:49:08,236 INFO HbmBinder:2233 - Mapping collection: events.Event.attendees -> ATTENDEE
[java] 15:49:08,246 INFO HbmBinder:2233 - Mapping collection: events.Person.attendances -> ATTENDEE
[java] 15:49:08,246 INFO Configuration:1027 - processing association property references
[java] 15:49:08,246 INFO Configuration:1049 - processing foreign key constraints
[java] 15:49:09,198 WARN RootClass:210 - composite-id class does not override equals(): events.Attendees
[java] 15:49:09,208 WARN RootClass:215 - composite-id class does not override hashCode(): events.Attendees
[java] 15:49:09,218 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 15:49:09,218 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 15:49:09,218 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[java] 15:49:09,228 INFO DriverManagerConnectionProvider:80 - using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://local
host:1433;databaseName=FREYA_DB
[java] 15:49:09,228 INFO DriverManagerConnectionProvider:86 - connection properties: {user=freya, password=****}
[java] 15:49:10,742 INFO SettingsFactory:77 - RDBMS: Microsoft SQL Server, version: 09.00.1399
[java] 15:49:10,742 INFO SettingsFactory:78 - JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2
[java] 15:49:10,772 INFO Dialect:100 - Using dialect: org.hibernate.dialect.SQLServerDialect
[java] 15:49:10,852 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
[java] 15:49:10,852 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or t
ransactional second-level cache is not recommended)
[java] 15:49:10,852 INFO SettingsFactory:125 - Automatic flush during beforeCompletion(): disabled
[java] 15:49:10,852 INFO SettingsFactory:129 - Automatic session close at end of transaction: disabled
[java] 15:49:10,862 INFO SettingsFactory:144 - Scrollable result sets: enabled
[java] 15:49:10,862 INFO SettingsFactory:152 - JDBC3 getGeneratedKeys(): enabled
[java] 15:49:10,862 INFO SettingsFactory:160 - Connection release mode: auto
[java] 15:49:10,872 INFO SettingsFactory:187 - Default batch fetch size: 1
[java] 15:49:10,872 INFO SettingsFactory:191 - Generate SQL with comments: disabled
[java] 15:49:10,872 INFO SettingsFactory:195 - Order SQL updates by primary key: disabled
[java] 15:49:10,872 INFO SettingsFactory:338 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[java] 15:49:10,882 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
[java] 15:49:10,882 INFO SettingsFactory:203 - Query language substitutions: {}
[java] 15:49:10,882 INFO SettingsFactory:209 - Second-level cache: enabled
[java] 15:49:10,882 INFO SettingsFactory:213 - Query cache: disabled
[java] 15:49:10,882 INFO SettingsFactory:325 - Cache provider: org.hibernate.cache.NoCacheProvider
[java] 15:49:10,882 INFO SettingsFactory:228 - Optimize cache for minimal puts: disabled
[java] 15:49:10,882 INFO SettingsFactory:237 - Structured second-level cache entries: disabled
[java] 15:49:10,902 INFO SettingsFactory:257 - Echoing all SQL to stdout
[java] 15:49:10,902 INFO SettingsFactory:264 - Statistics: disabled
[java] 15:49:10,902 INFO SettingsFactory:268 - Deleted entity synthetic identifier rollback: disabled
[java] 15:49:10,902 INFO SettingsFactory:283 - Default entity-mode: POJO
[java] 15:49:11,123 INFO SessionFactoryImpl:155 - building session factory
[java] 15:49:12,145 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
[java] 15:49:12,145 INFO SessionFactoryImpl:432 - Checking 0 named queries
[java] Hibernate: select person0_.PERSON_ID as PERSON1_1_0_, person0_.age as age1_0_, person0_.firstname as firstname1_0_, person0_.lastname as l
astname1_0_ from PERSON person0_ where person0_.PERSON_ID=?
[java] Hibernate: select attendance0_.PERSON_ID as PERSON2_1_, attendance0_.EVENT_ID as EVENT1_1_, attendance0_.EVENT_ID as EVENT1_2_0_, attendan
ce0_.PERSON_ID as PERSON2_2_0_, attendance0_.NAME as NAME2_0_ from ATTENDEE attendance0_ where attendance0_.PERSON_ID=?
[java] 15:49:12,466 INFO DefaultLoadEventListener:95 - Error performing load command
[java] Exception in thread "main" org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_ref
lection_optimizer=false for more info) setter of events.Attendees.setEvent
[java] at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:101)
[java] at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:312)
[java] at org.hibernate.type.ComponentType.resolve(ComponentType.java:530)
[java] at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:229)
[java] at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
[java] org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for
more info) setter of events.Attendees.setEvent
[java] at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:553)
[java] at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:101)
[java] at org.hibernate.type.ComponentType.setPropertyValues(ComponentType.java:312)
[java] at org.hibernate.type.ComponentType.resolve(ComponentType.java:530)
[java] at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:229)
[java] at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
[java] at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:553)
[java] at org.hibernate.loader.Loader.doQuery(Loader.java:689)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
[java] at org.hibernate.loader.Loader.loadCollection(Loader.java:1916)
[java] at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71)
[java] at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
[java] at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.ja
va:60)
[java] at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1593)
[java] at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
[java] at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
[java] at org.hibernate.loader.Loader.doQuery(Loader.java:689)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
[java] at org.hibernate.loader.Loader.loadCollection(Loader.java:1916)
[java] at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71)
[java] at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:520)
[java] at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.ja
va:60)
[java] at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1593)
[java] at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
[java] at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:791)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:228)
[java] at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
[java] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
[java] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2729)
[java] at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
[java] at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
[java] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
[java] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2729)
[java] at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
[java] at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
[java] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
[java] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:82)
[java] at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:809)
[java] at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:771)
[java] at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:62)
[java] at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
[java] at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:133)
[java] at events.Person$$EnhancerByCGLIB$$d766908a.getFirstname(<generated>)
[java] at events.EventManager.getPerson(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
[java] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
[java] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:82)
[java] at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:809)
[java] at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:771)
[java] at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:62)
[java] at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
[java] Caused by: net.sf.cglib.beans.BulkBeanException: java.lang.Long
[java] at events.Attendees$$BulkBeanByCGLIB$$c30401f6.setPropertyValues(<generated>)
[java] at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:97)
[java] ... 31 more
[java] Caused by: java.lang.ClassCastException: java.lang.Long
[java] ... 33 more
[java] at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:133)
[java] at events.Person$$EnhancerByCGLIB$$d766908a.getFirstname(<generated>)
[java] at events.EventManager.getPerson(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: net.sf.cglib.beans.BulkBeanException: java.lang.Long
[java] at events.Attendees$$BulkBeanByCGLIB$$c30401f6.setPropertyValues(<generated>)
[java] at org.hibernate.tuple.PojoComponentTuplizer.setPropertyValues(PojoComponentTuplizer.java:97)
[java] ... 31 more
[java] Caused by: java.lang.ClassCastException: java.lang.Long
[java] ... 33 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 11 seconds
C:\_HibernateHelloWorld\HelloWorldHibernate>
|