程序员的资源宝库

网站首页 > gitee 正文

springCloud——Dalston.SR5升级到Greenwich.SR2

sanyeah 2024-04-01 11:32:57 gitee 9 ℃ 0 评论

老项目:

SpringBoot 版本 :1.5.13.RELEASE

SpringCloud 版本:Dalston.SR5

项目升级:

SpringBoot 版本 :2.1.6.RELEASE

SpringCloud 版本:Greenwich.SR2

 

武器:

https://mvnrepository.com/

https://start.spring.io/

 

有些依赖发生了变化,记录一下:

org.springframework.cloud:spring-cloud-starter-feign --> org.springframework.cloud:spring-cloud-starter-openfeign 

org.springframework.cloud:spring-cloud-starter-eureka-server --> org.springframework.cloud:spring-cloud-starter-netflix-eureka-server

HikariCP --> org.springframework.boot:spring-boot-starter-jdbc   https://www.jb51.net/article/157642.htm

org.springframework.cloud:spring-cloud-starter-hystrix-dashboard --> org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard

org.springframework.cloud:spring-cloud-starter-hystrix -->  org.springframework.cloud:spring-cloud-starter-netflix-hystrix

org.springframework.cloud:spring-cloud-starter-turbine --> org.springframework.cloud:spring-cloud-starter-netflix-turbine

 

 

 mysql:mysql-connector-java 不用加版本号

 

org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.1

 

spring boot 2 把jar{}变成bootJar{}了

 

compile group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2' 对象序列化使用kryo

compile group: 'de.javakaffee', name: 'kryo-serializers', version: '0.45' 这个加上可以让kryo序列化集合,否则的话对集合进行序列化的时候会抛出异常

compile group: 'net.spy', name: 'spymemcached', version: '2.11.7' memcached缓存包

这个异常还是由于集合序列化失败。。。

解决方案:

1)compile group: 'de.javakaffee', name: 'kryo-serializers', version: '0.45' 加这个,然而还是抛异常

2)修改key值,因为缓存里的老数据仍然是不能序列化的,然而还是抛异常

3)kryo初始化的时候 添加 UnmodifiableCollectionsSerializer https://www.programcreek.com/java-api-examples/?api=de.javakaffee.kryoserializers.UnmodifiableCollectionsSerializer 然而还是抛异常

4)最后 放弃使用kryo了。。。直接使用 Serializable 

 

解决:

com.fasterxml.jackson.databind.JsonNode; 换成  com.alibaba.fastjson.JSONObject;

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表