springboot结合redis使用CachingConfigurerSupport方法不能被继承
2016-03-11 15:46
8173 查看
关于 springboot结合redis使用CachingConfigurerSupport方法不能被继承:
今日在开发中遇到了一个棘手的问题,就是redis中CachingConfigurerSupport方法不能继承的问题,原来的springboot的代码为:
修改之后的代码为:
开发中经常遇到版本的问题,这类问题也是很头疼的,大家尽量避免吧
今日在开发中遇到了一个棘手的问题,就是redis中CachingConfigurerSupport方法不能继承的问题,原来的springboot的代码为:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.1.9.RELEASE</version> </parent> <!-- Add typical dependencies for a web application --> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>这代码诈一看上去没啥问题,可是结合redis的时候问题就来了,redisConfig不能继承CachingConfigurerSupport类,这个类是在配置当中必须使用的。最后的解决方法就是——————修改springboot版本,现在我用的是1.1.9版本的springboot,这样的话就没有CachingConfigurerSupport类,深入点说就是spring-context-support类中没有CachingConfigurerSupport,这时我们将版本升级到1.2.3的时候,就会出现这个类,困扰了一天的问题特此记录,也希望遇到这个问题的人少走弯路。
修改之后的代码为:
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.3.RELEASE</version> </parent> <!-- Add typical dependencies for a web application --> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
开发中经常遇到版本的问题,这类问题也是很头疼的,大家尽量避免吧
相关文章推荐
- redis 学习指南
- redis 学习笔记(1)-编译、启动、停止
- Redis 是什么?
- Redis安装部署
- redis基本命令之二:集合、有序集合
- 国内外三个不同领域巨头分享的Redis实战经验及使用场景
- Windows 下Redis的安装教程和PHP使用Redis示例
- Redis复制(replication)
- Redis作者谈Redis应用场景
- Redis内存使用优化与存储
- centos7安装redis
- nginx-tomcat负载均衡redis-session共享,静态资源分离
- Nginx负载平衡 + Tomcat + 会话存储Redis配置要点
- Redis-HA高可用方案Sentinel配置
- redis-master/slave模式
- redis -编译、启动、停止
- redis-集群(cluster)创建并使用redis集群(二)
- centos6.6上安装redis3.0
- window 下安装redis
- redisson2.2.2 使用redis命令 ZREVRANGE 排序