spring整合redis问题
报错No qualifying bean of type [org.springframework.data.redis.core.RedisTemplate]
可能原因:spring版本问题,我将spring版本调到4.0.6的话报的这个错误,调回3.2.3没有问题,主要是下面几个spring插件的版本问题造成的。
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.2.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>3.2.3.RELEASE</version> </dependency>
我的application-config.xml配置如下
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan
base-package="com.hainan.cs"/>
<context:property-placeholder location="classpath:redis.properties" />
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig"> <property name="maxIdle" value="${redis.maxIdle}" /> <property name="testOnBorrow" value="${redis.testOnBorrow}" /> </bean> <bean id="connectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:host-name="${redis.host}" p:port="${redis.port}" p:pool-config-ref="poolConfig" p:password="${redis.pass}"/> <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate"> <property name="connectionFactory" ref="connectionFactory" /> </bean> <bean id="userDao" class="com.hainan.cs.dao.UserDaoImp"></bean>
</beans>
spring整合redis问题相关推荐
- Spring整合Redis时报错:java.util.NoSuchElementException: Unable to validate object
我在Spring整合Redis时报错,我是犯了一个很低级的错误! 我设置了Redis的访问密码,在Spring的配置文件却没有配置密码这一项,配置上密码后,终于不报错了!
- 网站性能优化小结和spring整合redis
现在越来越多的地方需要非关系型数据库了,最近网站优化,当然从页面到服务器做了相应的优化后,通过在线网站测试工具与之前没优化对比,发现有显著提升. 服务器优化目前主要优化tomcat,在tomcat目录 ...
- can not load key value key was removed or redis-server went away 关于spring 整合redis 以及保存到redis
spring 整合redis 1. 引用依赖 <!--Redis--> <dependency><groupId>org.springframework.boot& ...
- 不要再找了,Java操作Redis、Spring整合Redis及SpringBoot整合Redis这里都有
文章开始之前先抛出一个问题:Jedis.Lettuce.Redisson以及RedisTemplate几者之间有什么区别,又有什么联系? 如果你心中已经很清晰的有了答案,那么本文你可以很轻松的阅读过去 ...
- Spring整合Redis做数据缓存(Windows环境)
当我们一个项目的数据量很大的时候,就需要做一些缓存机制来减轻数据库的压力,提升应用程序的性能,对于java项目来说,最常用的缓存组件有Redis.Ehcache和Memcached. Ehcache是 ...
- Spring整合Redis作为缓存
2019独角兽企业重金招聘Python工程师标准>>> 采用Redis作为Web系统的缓存.用Spring的Cache整合Redis. 一.关于redis的相关xml文件的写法 &l ...
- spring整合redis缓存
如果对spring cache不了解,这边有一篇文章详细的介绍了 http://jinnianshilongnian.iteye.com/blog/2001040 改项目基于maven构建 相关依赖 ...
- Spring整合redis,通过sentinel进行主从切换。(何志雄)--转
原文地址:http://blog.csdn.net/tzszhzx/article/details/44590871 实现功能描述: redis服务器进行Master-slaver-s ...
- Spring整合Redis详解
用注解驱动的方式来使用 Redis.和数据库事务一样,Spring 提供了缓存的管理器和相关的注解来支持类似于 Redis 这样的键值对缓存. 准备测试环境 首先,定义一个简单的角色 POJO,代码如 ...
最新文章
- Caliburn.Micro 资源随时添加
- html5拖动图像的关键字,6.7 拖放图像 - HTML5 Canvas 实战
- SPRING多个占位符配置文件解析源码研究--转
- GMIS 2017大会邓力演讲:无监督学习的前沿与SPDG方法的优良性
- matlab制作以太网数据接收上位机_Python制作串口通讯上位机
- SP和Fuction的关系
- java后台处理excel_java后台利用Apache poi 生成excel文档提供前台下载示例
- 计算机网络流媒体播放,流媒体播放方式包含以下哪几种方式
- 为什么李开复说科大讯飞不懂语音,99%的语音识别项目要死掉?
- 模板中的占位符替换问题
- php微信个人号api,ItChat
- 计算机课数据排序与筛选ppt,《EXCEL 数据排序与筛选》教学设计
- (Python+OpenCV)图像平移
- Docker中LNMP分布式容器部署
- html+dwcs6代码,Dreamweaver cs6如何快速整理代码?
- UE4 坐标系 坐标轴旋转轴
- 微信 Windows 版本干了件大事!
- springCloud-Eureka自我保护模式
- 印象派绘画在现代艺术发展中的地位和作用
- 黑客利用WordPress 插件暗中建立后门网站
热门文章
- Unity3d UGUI 通用Confirm确认对话框实现(Inventory Pro学习总结)
- EXPDP Fails With ORA-04031 (streams pool, ...)
- Tomcat和JBoss都是服务器,有什么区别呢
- Nginx Upload Module 上传模块
- 保存OpenCV中Mat_Vec3f格式的图像
- 《阿甘正传》,看了很多遍,是否留意到这个镜头???
- pycharm查看关键词的方法
- Error Could not open client transport with JDBC Uri jdbchive2hadoop10210000 Failed to open new sessi
- 面试题02.07.链表相交
- Kernel(核函数)