1. 问题描述

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxxxxx': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.xx.common.localcache.GuavaCacheManager] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

如果你在代码中用到jar中的类, 如

@Resource
private GuavaCacheManager guavaCacheManager;

2.解决方法

很显然 这个GuavaCacheManager无法被spring注入 因为并没有纳入spring管理,就是没有使用<bean id="xxx">或者@Service、@Compent扫描注入

所以需要 new一下。

如果jar中有spring配置文件,如jar根目录下有/spring/a.xml

那么 在web.xml中把这个xml扫描就行了

    <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/applicationContext.xml,
classpath*:/spring/*.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

org.springframework.beans.factory.NoSuchBeanDefinitionException的更多相关文章

  1. nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException

    You should autowire interface AbstractManager instead of class MailManager. If you have different im ...

  2. Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

    1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -he ...

  3. 添加事务后 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type available

    今天遇到了一个奇怪的问题   在没添加事务之前  所有的代码都是好的 , 当我添加了事务之后, 代码报错 org.springframework.beans.factory.NoSuchBeanDef ...

  4. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager'

    1.错误描述 五月 01, 2015 2:12:31 下午 org.hibernate.validator.util.Version <clinit> 信息: Hibernate Vali ...

  5. spring Boot异步操作报错误: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.self.spring.springboot.Jeep' available

    我也是最近开始学习Spring Boot,在执行异步操作的时候总是汇报如下的错误: Exception in thread "main" org.springframework.b ...

  6. Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type "" available: expected at least 1 bean which qualifies as autowire candidate

    项目使用spring, mybatis.因为分了多个模块,所以会这个模块引用了其它模块的现在,结果使用Junit测试的时候发现有两个模块不能自动注入dao和service问题.解决后在此记录一下. 解 ...

  7. Spring Boot 调用 MongoRepository时报org.springframework.beans.factory.NoSuchBeanDefinitionException错误的解决办法

    这个问题整整折腾了我两天,现在记录下来,希望可以帮助和我一样,遇到相同问题的小伙伴. 项目是分层的(Intellij IDEA中的模块Module),有API(Core)层,Service&D ...

  8. Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException

    今天在学习spring 框架的时候看着,很简单.但是在真正开始做的时候发现,异常一个接着一个,整的肚子都被搞大了. Exception in thread "main" org.s ...

  9. 解决org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cacheManager' is defined

    在Spring配置文件中加入了支持注解,即<mvc:annotation-driven/> 重新启动服务器包 org.springframework.beans.factory.NoSuc ...

  10. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defined

    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defi ...

随机推荐

  1. [原创]Redis 持久化说明及配置

    目录 参考链接 介绍 RDB 持久化 优点 缺点 相关配置参数 AOF 持久化 优点 缺点 相关配置参数 参考链接 持久化 Redis命令参考 介绍 Redis 运行时数据保存在内存中, 一旦重启则数 ...

  2. 停不下来队 Scrum Meeting 博客汇总

    停不下来队 Scrum Meeting 博客汇总 一.Alpha阶段 [Alpha]Scrum Meeting#1 [Alpha]Scrum Meeting#2 [Alpha]Scrum Meetin ...

  3. 3.抓包神器Fiddler简介(转载)

    转自:https://www.cnblogs.com/ailiailan/p/hanxiaobei.html 使用Fiddler的两个场景,1:客户端对服务端返回数据的容错:2:服务端对异常请求数据的 ...

  4. 前端+php实现概率抽奖

    转前端之后,后台工程师大大跑路了只能兼任他的位置写点东西了 前端+后台抽奖代码网上一大堆,引用一位仁兄前面的代码(比较懒抱歉,后面数据处理,奖项判断是否抽完我将会标红,因为前面的代码网上太多了都能找到 ...

  5. 02-oracle字符函数

    字符函数(scott/tiger 登陆) --upper(col name)将字符大写 --lower(col name)将字符小写 --initcap(col name)字符串的首字母大写,其余小写 ...

  6. mojing手柄遥杆控制

    using UnityEngine; using UnityEngine.UI; using System.Collections; using MojingSample.CrossPlatformI ...

  7. sql 查询目标数据库中所有的表以其关键信息

    1.查询目标库中的所有表 SELECT obj.name tablename, ---表名 schem.name schemname, ---表所属的方案 idx.rows, ---一共有几行数组 C ...

  8. 【.Net】 C#参数数组与函数重载

    static int ParamsFunc(int i, string s) { return i; } static int ParamsFunc(int i, string s, params i ...

  9. 栈C++实现

    栈的核心是LIFO(Last In First Out),即后进先出 出栈和入栈只会对栈顶进行操作,栈底永远为0.如果是入栈,要将入栈元素赋值给栈数组,再将栈顶上移一位:出栈时要先将栈顶下移一位,再将 ...

  10. Codeforces 671 A——Recycling Bottles——————【思维题】

     Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standard ...