springboot结合redis使用CachingConfigurerSupport方法不能被继承

关于 springboot结合redis使用CachingConfigurerSupport方法不能被继承:

今日在开发中遇到了一个棘手的问题,就是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>

开发中经常遇到版本的问题,这类问题也是很头疼的,大家尽量避免吧


  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值