일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 선형회귀
- java
- 자바강좌
- 파이썬강의
- 백준 알고리즘
- JAVA강좌
- supervised learning
- C언어
- 딥러닝공부
- 머신러닝 강좌
- 파이썬강좌
- 자바
- 자바시작하기
- python강좌
- Gradient Descent
- 지도학습
- 비용함수
- acmicpc.net
- 딥러닝
- Python강의
- 경사하강법
- 머신러닝 강의
- c언어 오목
- 머신러닝공부
- 인공지능
- 효묘블로그
- feature scaling
- unsupervised learning
- 비지도학습
- 머신러닝
Archives
- Today
- Total
컴공과컴맹효묘의블로그
[Spring] Swagger Issue "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()" 본문
개발/버그로그
[Spring] Swagger Issue "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()"
효묘 2023. 6. 12. 00:06반응형
Issue
스프링 부트 2.6.5 버전에서 Swagger를 사용하려고 했는데, 다음과 같은 오류가 났다.
Debug Console
Caused by: java.lang.NullPointerException: Cannot invoke "org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()" because the return value of "springfox.documentation.spi.service.contexts.Orderings.patternsCondition(springfox.documentation.RequestHandler)" is null
다음은 build.gradle
파일
buid.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '2.6.5'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.graalvm.buildtools.native' version '0.9.20'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.projectlombok:lombok:1.18.26'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
//Swagger
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'
implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
}
tasks.named('test') {
useJUnitPlatform()
}
원인
SpringBoot를 2.6 이상 버전으로 업그레이드 되었을 시 요청 경로를 ControllerHandler에 매칭시키기 위한 무언가가 작동됨,
spring.mvc.pathmatch.matching-strategy 기본값이 ant_path_matcher에서 path_patter_parser로 변경이 되어서 문제가 되는 것.
이를 ant_path_matcher로 변경하면 해결이 될 듯 함.
해결
application.properties
파일에서 다음을 입력한다.
spring.mvc.pathmatch.matching-stragey=ant_path_matcher
반응형
'개발 > 버그로그' 카테고리의 다른 글
[React] Uncaught TypeError: Cannot read properties of undefined (0) | 2022.06.19 |
---|---|
이유없이 git push 안될때 해결 (0) | 2022.06.12 |
Comments