spring整合hibernate出现的问题

[复制链接]
查看11 | 回复0 | 2021-1-27 07:15:46 | 显示全部楼层 |阅读模式
用spring整合hibernate,启动Tomcat后,出现Errorcreatingbeanwithname'sessionFactory'definedinclasspathresource[applicationContext.xml]:Invocationofinitmethodfailed;nestedexceptionisorg.springframework.beans.BeanInstantiationException:Couldnotinstantiatebeanclass[org.hibernate.cfg.Configuration]:Constructorthrewexception;这种错误,网上查说hibernate3.jar里面已经包含annotations相关包,在lib下边删除hibernate-annotations.jar和hibernate-commons-annotations.jar包,但我导入的包里就没有这两个包,不知道什么原因,希望各位可以指点一下,
applicationContext.xml下面hibernate相关属性如下:



org.hibernate.dialect.MysqlDialect
true
true
update



com/dl/domain/Produce.hbm.xml


分 -->
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行