2019独角兽企业重金招聘Python工程师标准>>>

SpringBoot2.X 使用中发现的问题(持续更新中...)

redis:

这种已经不在使用了

@Bean
public CacheManager cacheManager(RedisTemplate redisTemplate) {RedisCacheManager rcm = new RedisCacheManager(redisTemplate);return rcm;
}

建议切换成这种

/*** 管理缓存*/
@Bean
public CacheManager cacheManager(RedisConnectionFactory connectionFactory) {//初始化一个RedisCacheWriter RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory);//设置CacheManager的值序列化方式为JdkSerializationRedisSerializer,但其实RedisCacheConfiguration默认就是使用StringRedisSerializer序列化key,JdkSerializationRedisSerializer序列化value,所以以下注释代码为默认实现//ClassLoader loader = this.getClass().getClassLoader();//JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer(loader);//RedisSerializationContext.SerializationPair<Object> pair = RedisSerializationContext.SerializationPair.fromSerializer(jdkSerializer);//RedisCacheConfiguration defaultCacheConfig=RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair);RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig();//设置默认超过期时间是30秒//defaultCacheConfig.entryTtl(Duration.ofSeconds(30));//初始化RedisCacheManager RedisCacheManager cacheManager = new RedisCacheManager(redisCacheWriter, defaultCacheConfig);return cacheManager;
}

mysql:

驱动也已经修改了 换成 com.mysql.cj.jdbc.Driver

spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driver

转载于:https://my.oschina.net/u/3526783/blog/3010076

SpringBoot2.XX 产生的问题相关推荐

  1. SpringBoot + Spring Security 学习笔记(一)自定义基本使用及个性化登录配置

    官方文档参考,5.1.2 中文参考文档,4.1 中文参考文档,4.1 官方文档中文翻译与源码解读 SpringSecurity 核心功能: 认证(你是谁) 授权(你能干什么) 攻击防护(防止伪造身份) ...

  2. 这是一篇优雅的Springboot2.0使用手册

    最近再研究springboot的原理?颇有收获,现在让我分享一下springboot如何使用吧~ 想要解锁更多新姿势?请访问我的博客 啥是Springboot 和书上理解的不同,我认为Springbo ...

  3. 零基础快速入门SpringBoot2.0教程 (二)

    一.SpringBoot2.x使用Dev-tool热部署简介:介绍什么是热部署,使用springboot结合dev-tool工具,快速加载启动应用官方地址:https://docs.spring.io ...

  4. SpringBoot2.0 整合 Redis集群 ,实现消息队列场景

    本文源码 GitHub地址:知了一笑 https://github.com/cicadasmile/middle-ware-parent 一.Redis集群简介 1.RedisCluster概念 Re ...

  5. SpringBoot2.x(3)---基础入门

    SpringBoot2.x(3)---基础入门 一.概述 Spring Boot设计目的是用来简化新Spring应用的初始搭建以及开发过程.Spring Boot并不是对Spring功能上的增强,而是 ...

  6. SpringBoot2 核心知识点

    1. SpringBoot 简介 1.1 Spring能做什么 1.2 Spring 的生态 官网:https://spring.io/projects/spring-boot 覆盖了:web 开发. ...

  7. SpringBoot2学习笔记

    SpringBoot2 SpringBoot2基础入门 Spring与SpringBoot SpringBoot优点 Create stand-alone Spring application 创建独 ...

  8. SpringBoot2.0整合Redis实战

    SpringBoot2.x整合Redis实战 1.分布式缓存Redis介绍 简介:讲解为什么要用缓存和介绍什么是Redis,新手练习工具 1.redis官网 https://redis.io/down ...

  9. SpringBoot2.0.3+Mybatis+Mysql+druid实现读写分离+事务+切换数据源失败

    mysql支持一主多从,即在写库的数据库发生变动时,会同步到所有从库,只是同步过程中,会有一定的延迟(除非业务中出现,立即写立即读,否则稍微的延迟是可以接收的). mysql的主从复制的配置参考:ht ...

最新文章

  1. OpenCV 相机校正过程中,calibrateCamera函数projectPoints函数的重投影误差的分析
  2. 元数据驱动的微服务架构(上)
  3. java 输出js实现地址跳转
  4. Windows操作系统产品名与内部版本号的对应(windows版本号)
  5. load average多少是正常_从阿里大促中,我理出的CPU与Load异常排查思路
  6. 第1章 Ext JS开发基本环境准备与项目创建[3/4]
  7. 强引用、软引用、弱引用、虚引用、终结器引用
  8. github客户端的使用
  9. python偏最小二乘法公式,python3 偏最小二乘法实现
  10. 域名型通配符ssl证书_通配符SSL证书是否支持三级子域名?
  11. Codevs 1253 超级市场
  12. 视频播放插件AVPro1-插件介绍
  13. 超牛逼的几款轻量级笔记软件!
  14. Redis 中的 集合(Set) SCARD:获取集合包含的元素数量
  15. 创客集结号:国内无人机技术发展的难点有哪些?
  16. 1-系统C盘迁移到新买的固态硬盘SSD中有影响但不主要,但有必要将系统盘C盘迁移到新安装的 固态硬盘SSD中吗?
  17. 九龙证券|次新股叠加智慧交通+信创+数字经济概念,开盘冲涨停!
  18. [教程]使用Lite MP4 Tool专业制作MP4(AVC)视频格式 - 指导教程
  19. python程序设计(江红)第1课时
  20. 科技公司融资潮后怎么走?Snap公司40亿美元投石问路

热门文章

  1. Linux运维系统工程师系列---16
  2. JavaScript —— 如何判断一个非数字输入
  3. Nokia是否还有未来 - 小议诺基亚和微软的战略布局
  4. Slide:深入了解Oracle自动内存管理ASMM by Maclean Liu
  5. 一位软件工程师的6年总结【转】
  6. DOM Node Element Attr 的联系与区别汇总
  7. 解决SSH连接Linux超时自动断开
  8. python的with用法(参考)
  9. Python基础(9)水仙花数
  10. WPF 支持分组互斥的 RadioButton 式单选菜单