不知道什么原因,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节: 如何使用源码
182017-08-05
相似问题