Injection of resource dependencies failed

luceas 2013-09-11 01:58:27
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;
...全文
15057 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hcy370037 2016-04-13
  • 打赏
  • 举报
回复
我的注解包路径都对还是报错 怎样解决
hcy370037 2016-04-13
  • 打赏
  • 举报
回复
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adcCorpDAO': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emosSessFactory' defined in ServletContext resource [/WEB-INF/spring/dao/applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
baidu_27508011 2015-04-18
  • 打赏
  • 举报
回复
注解DAO和service报错,如何解决?
luceas 2013-09-11
  • 打赏
  • 举报
回复
是扫描包路径的问题,不知道什么时候头脑发热,被我改掉了
luceas 2013-09-11
  • 打赏
  • 举报
回复
<aop:aspectj-autoproxy /> <context:component-scan base-package="com.wondershare.router.service" />
soton_dolphin 2013-09-11
  • 打赏
  • 举报
回复
beans 的xml里面有没有 <context:component-scan base-package="package-name"/>?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧