hiberante,报错

杨松坤 发布于 2012/10/16 17:29
阅读 482
收藏 0
17:26:51,497  INFO Environment:509 - Hibernate 3.2.3
17:26:51,507  INFO Environment:527 - loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.MySQLMyISAMDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.format_sql=true, hibernate.cache.region.factory_class=org.hibernate.cache.internal.NoCachingRegionFactory, hibernate.query.substitutions=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/sample, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
17:26:51,507  INFO Environment:558 - using java.io streams to persist binary types
17:26:51,507  INFO Environment:676 - Bytecode provider name : cglib
17:26:51,517  INFO Environment:593 - using JDK 1.4 java.sql.Timestamp handling
17:26:51,657  INFO Configuration:1426 - configuring from resource: /hibernate.cfg.xml
17:26:51,657  INFO Configuration:1403 - Configuration resource: /hibernate.cfg.xml
17:26:51,997 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
17:26:51,997 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
17:26:51,997 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
17:26:52,058 DEBUG Configuration:1387 - dialect=org.hibernate.dialect.MySQLDialect
17:26:52,058 DEBUG Configuration:1387 - connection.driver_class=net.sf.hibernate.dialect.MySQLDialect
17:26:52,078 DEBUG Configuration:1387 - connection.username=root
17:26:52,078 DEBUG Configuration:1387 - connection.password=
17:26:52,078 DEBUG Configuration:1387 - connection.url=jdbc:mysql://localhost/sample
17:26:52,078 DEBUG Configuration:1387 - show_sql=true
17:26:52,078 DEBUG Configuration:1586 - null< -org.dom4j.tree.DefaultAttribute@df8ff1 [Attribute: name resource value "Tuser.hbm.xml"]
17:26:52,078  INFO Configuration:553 - Reading mappings from resource : Tuser.hbm.xml
17:26:52,078 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
17:26:52,078 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
17:26:52,088 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
17:26:52,217  INFO HbmBinder:300 - Mapping class: ysk.hibernate.Tuser -> t_user
17:26:52,233 DEBUG HbmBinder:1270 - Mapped property: id -> id
17:26:52,248 DEBUG HbmBinder:1270 - Mapped property: name -> name
17:26:52,248  INFO Configuration:1541 - Configured SessionFactory: null
17:26:52,248 DEBUG Configuration:1542 - properties: {show_sql=true, java.vendor=Sun Microsystems Inc., hibernate.jdbc.batch_versioned_data=true, sun.java.launcher=SUN_STANDARD, hibernate.connection.url=jdbc:mysql://localhost/sample, sun.management.compiler=HotSpot Client Compiler, os.name=Windows 7, sun.boot.class.path=C:\Program Files\Java\jdk1.6.0_24\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_24\jre\lib\modules\jdk.boot.jar;C:\Program Files\Java\jdk1.6.0_24\jre\classes, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.6.0_24-b07, user.name=Administrator, connection.driver_class=net.sf.hibernate.dialect.MySQLDialect, user.language=zh, sun.boot.library.path=C:\Program Files\Java\jdk1.6.0_24\jre\bin, dialect=org.hibernate.dialect.MySQLDialect, java.version=1.6.0_24, user.timezone=Asia/Shanghai, sun.arch.data.model=32, java.endorsed.dirs=C:\Program Files\Java\jdk1.6.0_24\jre\lib\endorsed, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86, sun.jnu.encoding=GBK, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, hibernate.format_sql=true, java.class.version=50.0, user.country=CN, connection.url=jdbc:mysql://localhost/sample, java.home=C:\Program Files\Java\jdk1.6.0_24\jre, java.vm.info=mixed mode, sharing, os.version=6.1, path.separator=;, connection.password=, java.vm.version=19.1-b02, hibernate.cache.region.factory_class=org.hibernate.cache.internal.NoCachingRegionFactory, hibernate.max_fetch_depth=1, hibernate.connection.password=, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.connection.username=root, hibernate.cache.region_prefix=hibernate.test, user.home=C:\Users\Administrator.OJWDTJS2VRWIODT, hibernate.query.substitutions=yes 'Y', no 'N', java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\Program Files\Java\jdk1.6.0_24\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.6.0_24/bin/../jre/bin/client;C:/Program Files/Java/jdk1.6.0_24/bin/../jre/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_24, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=net.sf.hibernate.dialect.MySQLDialect, hibernate.proxool.pool_alias=pool1, connection.username=root, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, java.runtime.name=Java(TM) SE Runtime Environment, java.class.path=H:\ysk\WebRoot\WEB-INF\classes;E:\java\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_8.5.0.me201003231033\data\libraryset\EE_5\javaee.jar;E:\java\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_8.5.0.me201003231033\data\libraryset\EE_5\jsf-impl.jar;E:\java\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_8.5.0.me201003231033\data\libraryset\EE_5\jsf-api.jar;E:\java\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_8.5.0.me201003231033\data\libraryset\EE_5\jstl-1.2.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\commons-collections-2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\commons-logging.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\hsqldb-1.7.1.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\log4j-1.2.7.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\velocity-1.4-dev.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\xdoclet-1.2.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\xdoclet-hibernate-module-1.2.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\xdoclet-xdoclet-module-1.2.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\xjavadoc-1.0.2.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\middlegen-lib\middlegen-2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\middlegen-lib\middlegen-hibernate-plugin-2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\hibernateconsole.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\bsh-2.0b1.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\docking-0.3.2.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\forms-1.0.3.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\jgraph-5.0.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\jgraphaddons.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\l2fprod-common.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\looks-1.1.3.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\console\lib\pf-joi-full.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\tools\hibernate-tools.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\tools\lib\jdom.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate-extensions-2.1.3\tools\lib\velocity-1.3.1.jar;H:\ysk\WebRoot\WEB-INF\lib\junit4_lib\junit4_lib\junit.jar;H:\ysk\WebRoot\WEB-INF\lib\junit4_lib\junit4_lib\org.hamcrest.core_1.1.0.v20090501071000.jar;H:\ysk\WebRoot\WEB-INF\lib\Middlegen-Hibernate-r5\lib\mysql.jar;H:\ysk\WebRoot\WEB-INF\lib\ant-1.6.5.jar;H:\ysk\WebRoot\WEB-INF\lib\ant-antlr-1.6.5.jar;H:\ysk\WebRoot\WEB-INF\lib\ant-junit-1.6.5.jar;H:\ysk\WebRoot\WEB-INF\lib\ant-launcher-1.6.5.jar;H:\ysk\WebRoot\WEB-INF\lib\ant-swing-1.6.5.jar;H:\ysk\WebRoot\WEB-INF\lib\antlr-2.7.6.jar;H:\ysk\WebRoot\WEB-INF\lib\asm-attrs.jar;H:\ysk\WebRoot\WEB-INF\lib\asm.jar;H:\ysk\WebRoot\WEB-INF\lib\c3p0-0.9.1.jar;H:\ysk\WebRoot\WEB-INF\lib\cglib-2.1.3.jar;H:\ysk\WebRoot\WEB-INF\lib\cglib-2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\checkstyle-all.jar;H:\ysk\WebRoot\WEB-INF\lib\cleanimports.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-collections-2.1.1.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-dbcp-1.2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-lang-1.0.1.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-lang-2.0.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-logging-1.0.4.jar;H:\ysk\WebRoot\WEB-INF\lib\commons-pool-1.2.jar;H:\ysk\WebRoot\WEB-INF\lib\concurrent-1.3.2.jar;H:\ysk\WebRoot\WEB-INF\lib\connector.jar;H:\ysk\WebRoot\WEB-INF\lib\dom4j-1.6.1.jar;H:\ysk\WebRoot\WEB-INF\lib\dom4j-1.6.jar;H:\ysk\WebRoot\WEB-INF\lib\ehcache-1.1.jar;H:\ysk\WebRoot\WEB-INF\lib\ehcache-1.2.3.jar;H:\ysk\WebRoot\WEB-INF\lib\geronimo-spec-jta-1.0.1B-rc2.jar;H:\ysk\WebRoot\WEB-INF\lib\hibernate3.jar;H:\ysk\WebRoot\WEB-INF\lib\jaas.jar;H:\ysk\WebRoot\WEB-INF\lib\jacc-1_0-fr.jar;H:\ysk\WebRoot\WEB-INF\lib\javassist.jar;H:\ysk\WebRoot\WEB-INF\lib\jaxen-1.1-beta-7.jar;H:\ysk\WebRoot\WEB-INF\lib\jboss-cache.jar;H:\ysk\WebRoot\WEB-INF\lib\jboss-common.jar;H:\ysk\WebRoot\WEB-INF\lib\jboss-jmx.jar;H:\ysk\WebRoot\WEB-INF\lib\jboss-system.jar;H:\ysk\WebRoot\WEB-INF\lib\jdbc2_0-stdext.jar;H:\ysk\WebRoot\WEB-INF\lib\jgroups-2.2.8.jar;H:\ysk\WebRoot\WEB-INF\lib\jta.jar;H:\ysk\WebRoot\WEB-INF\lib\jtds-0.9.jar;H:\ysk\WebRoot\WEB-INF\lib\junit-3.8.1.jar;H:\ysk\WebRoot\WEB-INF\lib\log4j-1.2.11.jar;H:\ysk\WebRoot\WEB-INF\lib\log4j-1.2.9.jar;H:\ysk\WebRoot\WEB-INF\lib\msbase.jar;H:\ysk\WebRoot\WEB-INF\lib\mssqlserver.jar;H:\ysk\WebRoot\WEB-INF\lib\msutil.jar;H:\ysk\WebRoot\WEB-INF\lib\oscache-2.1.jar;H:\ysk\WebRoot\WEB-INF\lib\proxool-0.8.3.jar;H:\ysk\WebRoot\WEB-INF\lib\servlet.jar;H:\ysk\WebRoot\WEB-INF\lib\struts-menu-2.4.1.jar;H:\ysk\WebRoot\WEB-INF\lib\struts.jar;H:\ysk\WebRoot\WEB-INF\lib\swarmcache-1.0rc2.jar;H:\ysk\WebRoot\WEB-INF\lib\syndiag2.jar;H:\ysk\WebRoot\WEB-INF\lib\versioncheck.jar;H:\ysk\WebRoot\WEB-INF\lib\xerces-2.6.2.jar;H:\ysk\WebRoot\WEB-INF\lib\xml-apis.jar;H:\ysk\WebRoot\WEB-INF\lib\mysql-connector-java-5.0.3-bin.jar, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.level=Service Pack 1, java.io.tmpdir=C:\Users\ADMINI~1.OJW\AppData\Local\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files\Java\jdk1.6.0_24\jre\lib\ext;C:\Windows\Sun\Java\lib\ext, user.dir=H:\ysk, line.separator=
, java.vm.name=Java HotSpot(TM) Client VM, file.encoding=GBK, java.specification.version=1.6, hibernate.show_sql=true, hibernate.connection.pool_size=1}
17:26:52,248 DEBUG Configuration:1285 - Preparing to build session factory with filters : {}
17:26:52,248 DEBUG Configuration:1120 - processing extends queue
17:26:52,248 DEBUG Configuration:1124 - processing collection mappings
17:26:52,248 DEBUG Configuration:1135 - processing native query and ResultSetMapping mappings
17:26:52,248 DEBUG Configuration:1143 - processing association property references
17:26:52,248 DEBUG Configuration:1165 - processing foreign key constraints
17:26:52,389  INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
17:26:52,389  INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
17:26:52,389  INFO DriverManagerConnectionProvider:45 - autocommit mode: false
17:26:52,404 FATAL DriverManagerConnectionProvider:65 - JDBC Driver class not found: net.sf.hibernate.dialect.MySQLDialect
java.lang.ClassNotFoundException: net.sf.hibernate.dialect.MySQLDialect
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
 at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:61)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
 at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
 at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
 at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
 at ysk.main(ysk.java:18)
Exception in thread "main" org.hibernate.HibernateException: JDBC Driver class not found: net.sf.hibernate.dialect.MySQLDialect
 at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:66)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
 at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
 at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
 at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
 at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
 at ysk.main(ysk.java:18)
Caused by: java.lang.ClassNotFoundException: net.sf.hibernate.dialect.MySQLDialect
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
 at org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:61)
 ... 7 more
加载中
0
杨松坤
杨松坤
java.lang.ClassNotFoundException: net.sf.hibernate.dialect.MySQLDialect
0
情天大圣
情天大圣
木有JDBC驱动jar,如楼上
0
开源中国首席攻城师
开源中国首席攻城师
木有JDBC驱动jar,如楼上的楼上
0
pantrick
pantrick
这么明显的问题, hibernat3.2包名已经是org.hibernate开头了,net.sf这个属于旧配置了                                                
0
FatYU
FatYU
元芳,*******?
0
風一樣的男子
風一樣的男子

看的是年代久远的教材也就罢了

好歹得看一样Hibernate 3.2.3 jar包中是否有对应的类吧?

0
R-Lu
R-Lu
感觉是驱动没有了,最终倒是MySql方言解析失败,重点排查MySql驱动吧.
返回顶部
顶部