原项目功能部署
项目Boot版本升级遇到的问题
问题一
①无法启动,报错信息为
org.springframework.context.ApplicationContextException:
Failed to start bean 'documentationPluginsBootstrapper';
nested exception is java.lang.NullPointerException
②解决方案
yml添加路径匹配规则
spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
③原因
这是因为pom依赖
knife4j-spring-boot-starter
使用的Springfox使用的路径匹配是基于AntPathMatcher的,而Spring Boot 2.6.X开始默认使用的是PathPatternMatcher
问题二
①启动后访问接口报错无法找到Cache,报错信息为
nested exception is java.lang.IllegalArgumentException:
Cannot find cache named 'employeeCache' for Builder
[public com.itheima.reggie.common.R com.itheima.reggie.controller.
EmployeeController.selectPage(
java.lang.Integer,java.lang.Integer,java.lang.String)]
caches=[employeeCache] |
key=''page='+#p0+'_pageSize='+#p1+'_name='+#p2' | keyGenerator=''
| cacheManager='' | cacheResolver='' | condition='' | unless='' | sync='false']
with root cause
②解决方案
yml添加路径匹配规则
spring:
cache:
type: simple
③原因
这是因为新版本SpringBoot需要指定所使用的缓存管理器