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

来源:3-6 ——如何使用源代码

慕码人7165578

2017-06-30

 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)}

写回答

1回答

祁聪

2017-07-01

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

比如 ocPortal,

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

然后再启动项目即可


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

1
8
祁聪
回复
慕粉3217354
群里上传了项目导入说明,请查看
2017-08-05
共8条回复

Java SSM快速开发仿慕课网在线教育平台

学习整合微信公众平台开发、新浪SAE云平台、七牛云、分布式部署等等

1074 学习 · 449 问题

查看课程