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


老項目:

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;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM