当前位置: 代码迷 >> Java Web开发 >> Injection of resource dependencies failed,该怎么处理
  详细解决方案

Injection of resource dependencies failed,该怎么处理

热度:1601   发布时间:2016-04-14 20:44:05.0
Injection of resource dependencies failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customBlackListService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.wondershare.router.dao.CustomBlackListDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER)}


找不到依赖的dao,什么原因,spring3 自动注解的,为什么找不到.代码如下
@Repository("customBlackListDao")
public class CustomBlackListDaoImpl extends GeneralDaoSupport<CustomBlackList> implements CustomBlackListDao {

--一下是service调用dao的代码
@Service("customBlackListService")
public class CustomBlackListServiceImpl implements CustomBlackListService{
@Resource
private CustomBlackListDao customBlackListDao;

------解决思路----------------------
beans 的xml里面有没有 
<context:component-scan base-package="package-name"/>?
  相关解决方案