Hi, I'm new to Hibernate, but i made it work in few days, at home. Now, at work, I have to use it with an XML database, but I didn't try the integration jet, beacuse of this problem:
The application works fine till i build the Session Factory (there is no problem).
When i call the method buildSession(), it throws this exception:
Quote:
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:312)
net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:325)
net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:333)
persistenza.mySQL.MySQLMrcbDatabase.getSession(MySQLMrcbDatabase.java:43)
persistenza.mySQL.MySQLMrcbDatabase.autorizza(MySQLMrcbDatabase.java:123)
persistenza.Interrogatore.autorizza(Interrogatore.java:91)
This is the console:
Quote:
19-lug-2004 10.48.00 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.4
19-lug-2004 10.48.00 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=false, 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://localhost/biblio, hibernate.show_sql=true, hibernate.connection.pool_size=1}
19-lug-2004 10.48.00 net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
19-lug-2004 10.48.00 net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: d:\tomcat\webapps\biblio\Project.hbm.xml
19-lug-2004 10.48.04 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.Mrcb -> Mrcb
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbNumbersAndCodes -> MrcbNumbersAndCodes
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.lingua -> Lingua
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.paese -> Paese
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.isbn -> Isbn
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.issn -> Issn
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.cdu -> Cdu
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNumbersAndCodes.dewey -> Dewey
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbAddedEntry -> MrcbAddedEntry
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbSeriesStatement -> MrcbSeriesStatement
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbEditionImprintEtc -> MrcbEditionImprintEtc
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbEditionImprintEtc.edizione -> Edizione
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbTitleAndTitleRelated -> MrcbTitleAndTitleRelated
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbNotes -> MrcbNotes
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbNotes.note -> Note
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbPhysicalDescription -> MrcbPhysicalDescription
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollection
INFO: Mapping collection: modello.libro.relational.MrcbPhysicalDescription.descrizione -> Descrizione
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.MrcbMainEntry -> MrcbMainEntry
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.Serie -> Serie
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.Collaboratore -> Collaboratore
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.AutoreCongresso -> AutoreCongresso
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.AutoreCollettivo -> AutoreCollettivo
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.libro.relational.Autore -> Autore
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.utente.Utente -> Utente
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: modello.utente.Amministratore -> Amministratore
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-many association mappings
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbAddedEntry -> MrcbAddedEntry
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbNotes -> MrcbNotes
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbSeriesStatement -> MrcbSeriesStatement
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbEditionImprintEtc -> MrcbEditionImprintEtc
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbMainEntry -> MrcbMainEntry
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbTitleAndTitleRelated -> MrcbTitleAndTitleRelated
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbNumbersAndCodes -> MrcbNumbersAndCodes
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.Mrcb.mrcbPhysicalDescription -> MrcbPhysicalDescription
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.MrcbAddedEntry.collaboratore -> Collaboratore
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.MrcbSeriesStatement.serie -> Serie
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.MrcbMainEntry.autore -> Autore
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.MrcbMainEntry.autoreCollettivo -> AutoreCollettivo
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Binder bindCollectionSecondPass
INFO: Mapping collection: modello.libro.relational.MrcbMainEntry.autoreCongresso -> AutoreCongresso
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing one-to-one association property references
19-lug-2004 10.48.05 net.sf.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
19-lug-2004 10.48.05 net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.MySQLDialect
19-lug-2004 10.48.05 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximim outer join fetch depth: 1
19-lug-2004 10.48.05 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use outer join fetching: false
19-lug-2004 10.48.05 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
19-lug-2004 10.48.05 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
19-lug-2004 10.48.05 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/biblio
19-lug-2004 10.48.05 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=******, password=********}
19-lug-2004 10.48.05 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: true
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): true
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
19-lug-2004 10.48.06 net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.ehcache.hibernate.Provider
19-lug-2004 10.48.06 net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
19-lug-2004 10.48.07 net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
19-lug-2004 10.48.10 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JNDI name configured
19-lug-2004 10.48.10 net.sf.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
19-lug-2004 10.48.10 net.sf.ehcache.hibernate.Plugin <init>
WARNING: Could not find configuration for net.sf.hibernate.cache.UpdateTimestampsCache. Configuring using the defaultCache settings.
19-lug-2004 10.48.10 net.sf.hibernate.cache.QueryCache <init>
INFO: starting query cache at region: net.sf.hibernate.cache.QueryCache
19-lug-2004 10.48.10 net.sf.ehcache.hibernate.Plugin <init>
WARNING: Could not find configuration for net.sf.hibernate.cache.QueryCache. Configuring using the defaultCache settings.
****At this point the Session Facotory is built, and everything seems ok******
java.lang.NoClassDefFoundError: javax/transaction/Synchronization
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:312)
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:325)
at net.sf.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:333)
at persistenza.mySQL.MySQLMrcbDatabase.getSession(MySQLMrcbDatabase.java:43)
at persistenza.mySQL.MySQLMrcbDatabase.doInsertNuovaPubblicazione(MySQLMrcbDatabase.java:300)
at persistenza.mySQL.MySQLMrcbDatabase.main(MySQLMrcbDatabase.java:413)
Exception in thread "main"
I'm using Hibernate version 2.1.4, with MySQL version 4.0.
The mapping document works at home, so i don't think the problem is there. However, I'll post it.
It seems, to me, that it couldn't find a class of the javax package, but in the Java API there is no Synchronization class!
Can you help me?