• 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;

  • 相关阅读:
    POI处理Excel工具类
    Mac打开隐藏文件夹
    markdown语法
    U盘分区合并
    数组
    Java插入到mysql数据库显示问号?
    使用vmware打开别人提供好的vmx没反应怎么办?
    求长方形的外接圆
    读取mysql数据库
    excel对列的常用操作
  • 原文地址:https://www.cnblogs.com/gaoquanquan/p/11153286.html
Copyright © 2020-2023  润新知