knife4j
knife4j copied to clipboard
documentationPluginsBootstrapper NullPointerException issue in springboot 2.6.0
给遇到相同问题的朋友做个记录。 在springboot 2.6.0会提示documentationPluginsBootstrapper NullPointerException,具体位置的WebMvcPatternsRequestConditionWrapper中的condition为null。
原因是在springboot2.6.0中将SpringMVC 默认路径匹配策略从AntPathMatcher 更改为PathPatternParser,导致出错,解决办法是切换会原先的AntPathMatcher
spring.mvc.pathmatch.matching-strategy=ant-path-matcher
大哥,你真是太牛逼了,我正找这问题呢,登陆点个赞
我都考虑换spring doc了。 springfox长期不更新,想用spring indexer也不行。
我都考虑换 spring doc 了。 springfox 长期不更新,想用 spring indexer 也不行。
springdoc 确实还不错,而且兼容性还行
Change spring.mvc.pathmatch.matching-strategy
default values, don't worry about the impact on other components? Does the Spring community have a list of major impact components?
可以看看这里 https://github.com/springfox/springfox/issues/3462 也可以新建bean解决这个bug,但是会有新问题,那就是与knife4j有兼容问题,会导致knife4j不生成文档具体我还没仔细看
厉害! 厉害 !给你点赞!!!
2.6.2 实测还是有此问题
2.6.2 实测还是有此问题
Springfox has stopped maintenance. If you continue to use the Springfox bottom layer, please stay in the Springboot 2.5.x version. Or use the SpringDoc bottom layer instead.
请问有解决方案了吗?
Spring Boot 2.6.5 + knife4j-spring-boot-starter 2.0.9 用以下的配置才生效了,看了下常量的定义,需要下划线。
spring:
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
https://gitee.com/xiaoym/knife4j/issues/I5LIQZ
4.0.0快照版本适配了这种情况
处理代码:https://github.com/xiaoymin/swagger-bootstrap-ui/blob/dev/knife4j/knife4j-openapi2-spring-boot-starter/src/main/java/com/github/xiaoymin/knife4j/spring/common/bean/SpringFoxEnvironmentPostProcessor.java
4.1.0还是有这个问题