老項目:
SpringBoot 版本 :1.5.13.RELEASE
SpringCloud 版本:Dalston.SR5
項目升級:
SpringBoot 版本 :2.1.6.RELEASE
SpringCloud 版本:Greenwich.SR2
武器:
有些依賴發生了變化,記錄一下:
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;