be_better

[Springboot] swagger 에러 - Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 본문

Springboot/Error 해결

[Springboot] swagger 에러 - Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

NiceTry 2023. 11. 20. 02:25

목차

    swagger 에러

    dependencies {
    	implementation 'io.springfox:springfox-boot-starter:3.0.0'
    }

    dependencies에 swagger 의존성을 추가하고 Application을 실행시키면

     

    Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

     

    에러가 발생한다.

     

    원인으로는

    spring.mvc.pathmatch.matching-strategy의 default 값이 ant_path_matcher -> path_pattern_parser로 변경되면서 몇몇 라이브러리에서 발생이 된다고 한다.

     

    해결방법

    application.yml 파일에 pathmatch 을 설정해주면 된다.

    spring:
      mvc:
        pathmatch:
          matching-strategy: ant_path_matcher