[SpringBoot + Swagger]Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

배지원·2022년 10월 29일
0

에러

목록 보기
2/6

SpringBoot 에서 Swagger 연결과정 에러

1. 오류 내용

  • SpringBoot에서 api 통신 상태를 확인하기 위해 Swagger 페이지를 연결하여 확인할려고 연결 코드 입력하고 실행시 오류가 발생하였다.

관련 코드로 검색을 해보니 SpringBoot 2.6 버전 이후에는 설정이 변경되면서 Swagger를 포함한 라이브러리 몇몇에 오류가 발생한다.


오류메세지
Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException


2. 해결 방법

각 설정에 다음과 같이 추가해주면 된다.

application.properties인 경우

spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER

yaml인 경우인 경우

spring:
  mvc:
    pathmatch:
      matching-strategy: ant_path_matcher
profile
Web Developer

0개의 댓글