请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

不知道什么原因,tomcat启动时,这个Service里的DAO属性注入失败。源代码未改动。

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'portalServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.online.college.core.consts.service.IConstsClassifyService com.online.college.portal.business.impl.PortalServiceImpl.constsClassifyService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'constsClassifyServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.online.college.core.consts.dao.ConstsClassifyDao com.online.college.core.consts.service.impl.ConstsClassifyServiceImpl.entityDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.online.college.core.consts.dao.ConstsClassifyDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

正在回答 回答被采纳积分+3

1回答

祁聪 2017-07-01 20:55:41

service的jar包没有加载进去吧;如果是本地Eclipse启动,尝试这样解决:

比如 ocPortal,

ocPortal上右击 -》Properties-》Deployment Assembly -》Add-》双击Java Build Path Entries -》选中 Maven Dependencies 

然后再启动项目即可


或者参考教程第3章6节: 如何使用源码

1 回复 有任何疑惑可以回复我~
  • 坑主 #1
    我也报这个错,我已经选中了Maven Dependencies ,tomcat一直报这个问题
    回复 有任何疑惑可以回复我~ 2017-07-12 15:22:57
  • 坑主 #2
    老师,你的这个接口public interface AuthUserDao 没有实现类啊?这个下载地址也失效了http://git.imooc.com/5556428/s110-5556428.git,我在网站上下的代码好像不全?
    回复 有任何疑惑可以回复我~ 2017-07-12 15:47:55
  • 慕粉3217354 回复 坑主 #3
    哥,你搞定了吗
    回复 有任何疑惑可以回复我~ 2017-08-04 18:18:48
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号