Bonjour,
Debutant sous Hibernate, je cree un premier test sous Hibernate-3.1,
Eclipse 3.1.2.
J'ai mis dans le classpath (lib) les librairies suivantes :
antlr-2.7.6rc1.jar
ehcache-1.1.jar
cglib-2.1_3.jar
hibernate-2.0-beta-6.jar
hibernate3.jar
cglib-2.2_3_modif.jar
jdbc2_0-stdext.jar
commons-beanutils.jar
jta.jar
commons-collections-2.1.1.jar
log4j-1.2.9.jar
commons-lang-2.1.jar
commons-logging-1.0.4.jar
dom4j-1.6.1.jar
Ma base mySQL a 5 tables, qui sont regulierement parsees au run de mon projet.
Le pb arrive a la demande a la creation d'une SessionFactory, plus precisement a l'appel de la classe KeyFactory qu'il ne trouve pas.
Pour cause, elle existe dans cgilib-2.1_3 avec pour cheminnet/sf/cglib/core/KeyFactory.
Or d'apres mes recherches, cglib-1.x avait ce chemin (sans ../org/..)
Il me semble que c'est un code de hibernate-2.0-beta-6.jar qui provoque cet appel.
Ou est l'erreur sachant que je ne comprends pas pourquoi les dernieres versions de cglib et net.sf.hibernate.... ne sembleraient pas compatibles d'apres ce pb (et mon analyses ...)
Merci si quelqu'un peut me dire ou je me serais trompe ??
Le log log4j :
10:43:52,496 INFO Environment:378 - Hibernate 2.0 beta 6
10:43:52,503 INFO Environment:407 - hibernate.properties not found
10:43:52,507 INFO Environment:427 - using CGLIB reflection optimizer
10:43:52,511 INFO Environment:437 - JVM proxy support: true
10:43:52,513 INFO Configuration:670 - Configuration resource: /hibernate.cfg.xml
10:43:52,595 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath under net/sf/hibernate/
10:43:52,602 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... on-2.0.dtd in classpath
10:43:52,665 DEBUG Configuration:656 - hibernate.connection.url=jdbc:mysql:///LJKDB
10:43:52,666 DEBUG Configuration:656 - hibernate.connection.driver_class=
com.mysql.jdbc.Driver
10:43:52,667 DEBUG Configuration:656 - hibernate.connection.username=douville
10:43:52,667 DEBUG Configuration:656 - hibernate.connection.password=@@@@@
10:43:52,668 DEBUG Configuration:656 - dialect=
net.sf.hibernate.dialect.MySQLDialect
10:43:52,670 DEBUG Configuration:656 - hibernate.show_sql=true
10:43:52,678 DEBUG Configuration:656 - hibernate.use_outer_join=true
10:43:52,679 DEBUG Configuration:656 - hibernate.transaction.factory_class=
net.sf.hibernate.transaction.JDBCTransactionFactory
10:43:52,681 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@c1186f [Attribute: name resource value "BiblioAuteurs.hbm"]
10:43:52,682 INFO Configuration:252 - Mapping resource: BiblioAuteurs.hbm
10:43:52,687 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:52,690 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:52,825 INFO Collection:168 - Mapping class: com.jldo.hibernate.BiblioAuteurs -> BiblioAuteurs
10:43:52,917 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@299f7e [Attribute: name resource value "Biblio.hbm"]
10:43:52,917 INFO Configuration:252 - Mapping resource: Biblio.hbm
10:43:52,923 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:52,925 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:52,950 INFO Collection:168 - Mapping class: com.jldo.hibernate.Biblio -> Biblio
10:43:52,951 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@5388b5 [Attribute: name resource value "Personnel.hbm"]
10:43:52,952 INFO Configuration:252 - Mapping resource: Personnel.hbm
10:43:52,961 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:52,962 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:52,992 INFO Collection:168 - Mapping class: com.jldo.hibernate.Personnel -> Personnel
10:43:52,994 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@c7833c [Attribute: name resource value "Equipes.hbm"]
10:43:52,995 INFO Configuration:252 - Mapping resource: Equipes.hbm
10:43:53,000 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:53,002 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:53,018 INFO Collection:168 - Mapping class: com.jldo.hibernate.Equipes -> Equipes
10:43:53,019 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@152643 [Attribute: name resource value "ContratsHisto.hbm"]
10:43:53,020 INFO Configuration:252 - Mapping resource: ContratsHisto.hbm
10:43:53,027 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:53,028 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:53,053 INFO Collection:168 - Mapping class: com.jldo.hibernate.ContratsHisto -> ContratsHisto
10:43:53,059 DEBUG Configuration:803 - null<-org.dom4j.tree.DefaultAttribute@b23cf [Attribute: name resource value "Contrats.hbm"]
10:43:53,060 INFO Configuration:252 - Mapping resource: Contrats.hbm
10:43:53,068 DEBUG DTDEntityResolver:20 - trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
10:43:53,073 DEBUG DTDEntityResolver:29 - found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
10:43:53,095 INFO Collection:168 - Mapping class: com.jldo.hibernate.Contrats -> Contrats
10:43:53,096 INFO Configuration:852 - Configured SessionFactory: null
10:43:53,099 DEBUG Configuration:853 - properties: {hibernate.connection.password=l.vran!, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries, java.vm.version=1.4.2-54, awt.nativeDoubleBuffering=true, hibernate.connection.username=douville, gopherProxySet=false, java.vm.vendor="Apple Computer, Inc.", java.vendor.url=http://apple.com/, path.separator=:, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=unknown, java.vm.specification.name=Java Virtual Machine Specification, user.dir=/Users/douville/IDE.NB/HibernateTest, java.runtime.version=1.4.2_09-232, java.awt.graphicsenv=apple.awt.CGraphicsEnvironment, java.endorsed.dirs=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/endorsed, os.arch=ppc, java.io.tmpdir=/tmp, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., os.name=Mac OS X, sun.java2d.fontpath=, java.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java, java.specification.name=Java Platform API Specification, java.class.version=48.0, hibernate.transaction.factory_class=
net.sf.hibernate.transaction.JDBCTransactionFactory
, java.util.prefs.PreferencesFactory=java.util.prefs.MacOSXPreferencesFactory, os.version=10.4.6, user.home=/Users/douville, user.timezone=Europe/Paris, java.awt.printerjob=apple.awt.CPrinterJob, file.encoding=MacRoman, java.specification.version=1.4, hibernate.connection.driver_class=
com.mysql.jdbc.Driver
, user.name=douville, java.class.path=/Users/douville/IDE.NB/HibernateTest/bin:/Users/douville/IDE.NB/HibernateTest/lib/hibernate3.jar:/Users/douville/IDE.NB/HibernateTest/lib/jdbc2_0-stdext.jar:/Users/douville/IDE.NB/HibernateTest/lib/antlr-2.7.6rc1.jar:/Users/douville/IDE.NB/HibernateTest/lib/xalan.jar:/Users/douville/IDE.NB/HibernateTest/lib/commons-collections-2.1.1.jar:/Users/douville/IDE.NB/HibernateTest/lib/ehcache-1.1.jar:/Users/douville/IDE.NB/HibernateTest/lib/odmg-3.0.jar:/Users/douville/IDE.NB/HibernateTest/lib/dom4j-1.6.1.jar:/Users/douville/IDE.NB/HibernateTest/lib/commons-logging-1.0.4.jar:/Users/douville/IDE.NB/HibernateTest/lib/commons-lang-2.1.jar:/Users/douville/IDE.NB/HibernateTest/lib/log4j-1.2.9.jar:/Users/douville/IDE.NB/HibernateTest/lib/jta.jar:/Users/douville/IDE.NB/HibernateTest/lib/commons-beanutils.jar:/Users/douville/IDE.NB/HibernateTest/lib/cglib-2.1_3.jar:/Users/douville/IDE.NB/HibernateTest/lib/hibernate-2.0-beta-6.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home, sun.arch.data.model=32, hibernate.dialect=
net.sf.hibernate.dialect.MySQLDialect
, hibernate.connection.url=jdbc:mysql:///LJKDB, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=apple.awt.CToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_09, java.ext.dirs=/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home/lib/ext, sun.boot.class.path=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/laf.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/sunrsasign.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/jsse.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/charsets.jar, java.vendor=Apple Computer, Inc., file.separator=/, java.vendor.url.bug=http://developer.apple.com/java/, sun.io.unicode.encoding=UnicodeBig, sun.cpu.endian=big, hibernate.use_outer_join=true, mrj.version=232, dialect=
net.sf.hibernate.dialect.MySQLDialect
, sun.cpu.isalist=}
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:321)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:595)
at com.jldo.hibernate.base._BaseRootDAO.initialize(_BaseRootDAO.java:54)
at com.jldo.hibernate.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
at com.jldo.hibernate.HibernateTest.main(HibernateTest.java:23)