hibernate spring 自动注入报错

- Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager': Autowiring of methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.javaeye.sample.security.support.SecurityManagerSupport.init(org.hibernate.SessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext-dataAccess.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: tableNameBinding

 

 

这个错误大家有没有见过呢?我查了半天,没找到合适的解决方案

项目代码大吗?发给我:ulinkwo@163.com

可能你的hibernate jar包版本有冲突。

看看你的 这个配置文件/WEB-INF/classes/applicationContext-dataAccess.xml

还有你的包版本是不是不一致

检查一下spring,hibernate包的版本是否符合

是包版本的问题,像楼上说的,多检查一下。

看看这个兼容矩阵:[url]http://community.jboss.org/wiki/HibernateCompatibilityMatrix[/url]

hibernate jar包版本有冲突,就跟楼上说的多检查检查。

[code="java"]
3.0.4.RELEASE
3.5.5-Final
[/code]
这个两个版本的组合试过没?

为什么我在hibernate提供的下载地址上都找不到3.4这个版本,你从哪里下的?

你把hiberante-annotation去掉行不行,我记得好像是hibernate3.3以后已经把它合并到core包里了吧。
另一个,为什么你spring-dao的包版本和其他的差别很大?