Dialect class not found: org.hibernate.dialect.MySQLDialect

来源:互联网 发布:鹰眼 数据 编辑:程序博客网 时间:2024/05/17 22:28
提示异常:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.MysqlDialect


hibernate2.jar和hibernate3.jar包结构完全不同了

例如:

hibernate2中的net.sf.hibernate.dialect.SQLServerDialect

在hibernater3中变成了org.hibernate.dialect.SQLServerDialect  

用的是hibernate4,所以配置如下:

<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>

原创粉丝点击