hibernate配置错误如何解决?

[复制链接]
查看11 | 回复5 | 2010-8-9 12:39:34 | 显示全部楼层 |阅读模式
[job][root] 11:11:21,765 ERROR ContextLoader:203 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'user' defined in file [E:\Program Files\tomcat-6.0.18\webapps\_5t5fa\WEB-INF\classes\applicationContext-actions.xml]: Cannot resolve reference to bean 'userService' while setting bean property 'userService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [E:\Program Files\tomcat-6.0.18\webapps\_5t5fa\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in file [E:\Program Files\tomcat-6.0.18\webapps\_5t5fa\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\Program Files\tomcat-6.0.18\webapps\_5t5fa\WEB-INF\classes\applicationContext-common.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: com.job._5t5fa.domain.WebKuai
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in file [E:\Program Files\tomcat-6.0.18\webapps\_5t5fa\WEB-INF\classes\applicationContext-beans.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'userDao';

3
20
1800
3
3
20
0
200
3
true
thread
thread



回复

使用道具 举报

千问 | 2010-8-9 12:39:34 | 显示全部楼层
applicationContext-common.xml 中的sessionFactory 配置有误初始化未成功 导致userDao、userService出错com.job._5t5fa.domain.WebKuai 未映射的关联你把项目刷新看看 要是还报错的话 你要从复杂化慢慢简单化看退化到哪就没问题了 应该就能找出问题所在
回复

使用道具 举报

千问 | 2010-8-9 12:39:34 | 显示全部楼层
我也出现过这个问题,从可以运行的过程重新拷JAR包和applicationContext.xml,web.xml,struts.xml等配置文件覆盖,再改改里面内容就好了,反正是能正常运行了,不过到现在还不清楚是哪儿的问题,楼主试试吧。。死马当活马医了。。
回复

使用道具 举报

千问 | 2010-8-9 12:39:34 | 显示全部楼层
Spring配置的问题。'userService' 没有注册,或者写错了。另外Spring和Strut之间有插件struts-spring-plugin.jar不需要配action到spring里头。
回复

使用道具 举报

千问 | 2010-8-9 12:39:34 | 显示全部楼层
看样子 实体没创建出来,可能是 映射文件有问题,检查下吧
回复

使用道具 举报

千问 | 2010-8-9 12:39:34 | 显示全部楼层
userService创建失败,仔细检查!
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行