개발자 넋두리/코딩하다가..
[swagger] 연동하는데, 오류 발생할 경우
목표를 가지고 달린다
2022. 3. 28. 18:08
Spring Boot 공부하면서, swagger 연동 오류날 경우
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException
이런 에러가 발생했습니다
현제 사용하는 버전은
springboot : 2.6.5
swagger : 3.0.0
Spring boot 2.6버전 이후에 spring.mvc.pathmatch.matching-strategy 값이 ant_apth_matcher에서 path_pattern_parser로 변경되면서 몇몇 라이브러리(swagger포함)에 오류가 발생할 수 있다고 합니다.
[해결방안]
resource폴더안에 application.yml 에 아래 설정을 추가하면 오류가 발생 안합니다.
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher