본문 바로가기

Back-End/Spring

[Spring Boot] Swagger 연결 시 'Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException' 에러 발생

728x90

스프링 부트에서 프로젝트를 생성 후 Swagger 를 연결하고 있었는데, 아래와 같은 에러가 발생했습니다.

swagger 연결 시 에러 발생

 

에러 내용은 다음과 같습니다. 

org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException

 

Spring boot 2.6 버전 이후에 spring.mvc.pathmatch.matching-strategy 값이 ant_apth_pattern_parser 로 변경되면서 몇몇 라이브러리에서 오류가 발생하고 있었던 것입니다.

 

따라서, application.properties 파일에 아래와 같이 작성해줍니다.

spring.mvc.pathmatch.matching-strategy=ant_path_matcher

 

서버를 다시 실행하면 잘 구동되는 것을 확인할 수 있습니다.

 

 

 

728x90