Hibernate的问题

04-06-22 lhc_mail
我在运行ant时,出现如下错误,有谁知道是什么问题吗?
hbm.gen:
[echo] +---------------------------------------------------+
[echo] | |
[echo] | R U N N I N G H I B E R N A T E D O C L E T |
[echo] | |
[echo] +---------------------------------------------------+
[delete] Deleting 1 files from E:\javasave2\hibernate\gen

[hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/>

[hibernatedoclet] Generating mapping file for dbdemo.User.

[hibernatedoclet] dbdemo.User
[delete] Deleting 1 files from E:\javasave2\hibernate\test\scr
[copy] Copying 1 file to E:\javasave2\hibernate\test\scr

hbm.copy:
[copy] Copying 1 file to E:\javasave2\hibernate\bin\classes
[delete] Deleting 1 files from E:\javasave2\hibernate\test\scr
[copy] Copying 1 file to E:\javasave2\hibernate\test\scr

ddl:

[schemaexport] (cfg.Environment 462 ) Hibernate 2.1.2

[schemaexport] (cfg.Environment 496 ) loaded properties from resource hibernate.properties: {hibernate.connection.username=root, hibernate.connection.password=, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.MySQlDialect, hibernate.show_sql=true, hibernate.connection.url=jdbc:mysql://127.0.0.1:3306/xwap?useUnicode=true&characterEncoding=gb2312, hibernate.connection.driver_class=com.mysql.jdbc.Driver}

[schemaexport] (cfg.Environment 519 ) using CGLIB reflection optimizer

[schemaexport] (cfg.Configuration 166 ) Mapping file: E:\javasave2\hibernate\gen\dbdemo\User.hbm.xml

[schemaexport] (cfg.Binder 229 ) Mapping class: dbdemo.User -> Users

[schemaexport] BUILD FAILED: file:E:/javasave2/hibernate/build.xml:126: Schema text failed: Dialect class not found: net.sf.hibernate.dialect.MySQlDialect
Total time: 5 seconds

Hejrcc
2004-06-25 11:44
Dialect class not found:

可能的原因:
1. 你没有指定 Dialect,
2. Dialect 指定错了,
3. 不同的数据库 Dialect 是不同的,还有可能你没有正确的 jdbc, 或者在 classpath 里面找不到jdbc。