日期:2014-05-20  浏览次数:20762 次

一个很诡异的配置文件异常 拜求解决 关于Spring的配置

首先 我用的是mysql的数据库 然后再spring的配置文件中做了sessionFactory的配置

配置如下:
<value>
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/mytb
hibernate.connection.username=root
hibernate.connection.password=root
hibernate.dialect.org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
</value>

上面明明定义了数据库方言 但是老是报这个异常 在线等答案
Caused by: org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available
at org.hibernate.dialect.resolver.DialectFactory.buildDialect(DialectFactory.java:106)

------解决方案--------------------
hibernate.dialect.org.hibernate.dialect.MySQLDialect
你看清楚了 沒有“=”
------解决方案--------------------
如果配置没问题的话 看看这个:
http://yklovejava-163-com.iteye.com/blog/787434