hello
I begin with Hibernate and I try to run sample code, but I have a problem.
have all jar files, all xml fles and the porperties file but a bug persists.
I use MySQL dataBase and I have the following message when hibernate try to save:
Code:
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.4
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, hibernate.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:mysql://odn001/test, hibernate.show_sql=true, hibernate.connection.password=odima, hibernate.connection.pool_size=1}
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/hibernate/auction/AuctionItem.hbm.xml
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/hibernate/auction/Bid.hbm.xml
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.hibernate.auction.Bid -> Bid
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Binder bindSubclass
INFO: Mapping subclass: org.hibernate.auction.BuyNow -> Bid
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Configuration addClass
INFO: Mapping resource: org/hibernate/auction/User.hbm.xml
19 juil. 2004 09:47:13 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: org.hibernate.auction.User -> AuctionUser
19 juil. 2004 09:47:14 net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: org.hibernate.auction.Name, IllegalArgumentException: Cannot find matching method/constructor
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: org.hibernate.auction.User.bids -> Bid
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
19 juil. 2004 09:47:14 net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.MySQLDialect
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximim outer join fetch depth: 1
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: false
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://odn001/test
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=odima}
19 juil. 2004 09:47:14 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): true
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
19 juil. 2004 09:47:14 net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
19 juil. 2004 09:47:14 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JNDI name configured
19 juil. 2004 09:47:14 net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.MySQLDialect
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
19 juil. 2004 09:47:14 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
19 juil. 2004 09:47:14 net.sf.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: Running hbm2ddl schema export
19 juil. 2004 09:47:14 net.sf.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: exporting generated schema to database
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://odn001/test
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=odima}
19 juil. 2004 09:47:14 net.sf.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: schema export complete
19 juil. 2004 09:47:14 net.sf.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:mysql://odn001/test
19 juil. 2004 09:47:14 net.sf.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
19 juil. 2004 09:47:14 net.sf.ehcache.config.Configurator configure
ATTENTION: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/eclipse-SDK-3.0-win32/eclipse/workspace/EssaiHibernate/WEB-INF/lib/ehcache-0.7.jar!/ehcache-failsafe.xml
19 juil. 2004 09:47:14 net.sf.ehcache.hibernate.Plugin <init>
ATTENTION: Could not find configuration for net.sf.hibernate.cache.UpdateTimestampsCache. Configuring using the defaultCache settings.
19 juil. 2004 09:47:14 net.sf.hibernate.cache.QueryCache <init>
INFO: starting query cache at region: net.sf.hibernate.cache.QueryCache
19 juil. 2004 09:47:14 net.sf.ehcache.hibernate.Plugin <init>
ATTENTION: Could not find configuration for net.sf.hibernate.cache.QueryCache. Configuring using the defaultCache settings.
Setting up some test data
set ok
username : oldirty password : null email : oldirty@hibernate.org id : 1 initial : ol' dirty bastard
Hibernate: insert into AuctionUser (userName, `password`, email, firstName, `initial`, lastName) values (?, ?, ?, ?, ?, ?)
java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at net.sf.hibernate.util.GetGeneratedKeysHelper.prepareStatement(GetGeneratedKeysHelper.java:39)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:246)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:525)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at org.hibernate.auction.Main.createTestAuctions(Main.java:294)
at org.hibernate.auction.Main.main(Main.java:369)
Exception in thread "main"
is there someone who see what's append?
Have I forgatten something ?
thanx