系统要求:
jdk 8~19
1,mybatis 实体注解失败,
相应maven添加
<dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>2.0.1.Final</version> <scope>compile</scope> </dependency>
mybatis-spring-boot-starter 升级到2.2.2
com.github.pagehelper 升级 1.4.4
org.apache.shiro 升级 1.10.0
2,MultipartProperties 中 文件大小 的后缀,只识别大写
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
3,swagger 升级
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>3.0.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>3.0.0</version> <scope>compile</scope> </dependency>
Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X使用的是PathPatternMatcher,增加mvc配置,
spring: mvc: pathmatch: matching-strategy: ant_path_matcher
访问:http:/127.0.0.1/swagger-ui/index.html
注:swagger2的访问地址:是http:/127.0.0.1/swagger-ui.html
4,升级 shardingsphere
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-boot-starter</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-spring-namespace</artifactId>
<version>4.1.1</version>
</dependency>
5,spring.rabbitmq.publisher-confirms Deprecated
替换成:spring.rabbitmq.publisher-confirm-type=correlated
6,yml配置文件更改
Property 'spring.profiles.include[0]' imported from location 'class path resource [application-prod.yml]' is invalid in a profile specific resource [origin: class path resource [application-prod.yml] -
include不能单独使用
spring:
config:
import: application-common-prod.yml
7,升级 elasticsearch
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
报错:
Factory method 'esClient' threw exception; nested exception is java.lang.NoClassDefFoundError: jakarta/json/spi/JsonProvider
解决方案:
父模块添加声明依赖
<dependency>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.0.1</version>
</dependency>
8,升级后 ,屏蔽 自带的tomcat , 使用 undertow
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <!-- Exclude the Tomcat dependency --> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency>
9,升级后 监听器使用@ConfigurationProperties(prefix="website"),报空指针
没找到具体原因,
猜测可能是加载顺序的问题,监听器在springboot容器外,可能是监听器加载时,springboot没有加载完,导致空指针异常。
后来直接在监听器中使用@Value注入资源文件属性,打印俩次日志,第一次时空数据,第二次数据加载,可能还是容器外管理的问题,加载顺序不一致导致的。
暂时得到解决,后面再找具体原因,如果有知道的也可以评论栏给下提示,万分感谢