org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletComponentRegisteringPostProcessor': Unexpected exception during bean creation; nested exception is java.lang.NoClassDefFoundError: javax/servlet/annotation/WebServlet
JSP를 사용하기 위해 패키징을 War로 설정한 프로젝트에서 SpringApplication 실행 중 오류 발생
해결 방법
IntelliJ 무료 버전의 경우 해당 설정을 IntelliJ IDEA가 아니라 Gradle로 설정해야 한다.
Jar 파일의 경우는 문제가 없는데, War의 경우 톰캣이 정상 시작되지 않는 문제가 발생한다.
(유료 버전은 모두 정상 동작)
또는 build.gradle 에 있는 다음 코드를 제거해도 된다.
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
'ProblemSolving' 카테고리의 다른 글
| [SpringBoot] 프로젝트 생성 후 빌드 실패 (0) | 2023.01.20 |
|---|---|
| [IntelliJ] 메세지, 국제화 테스트 중 한글 깨짐 (0) | 2022.08.26 |
| [IntelliJ] Java file outside of source root (0) | 2022.08.26 |
| [Querydsl] Execution failed for task ':compileQuerydsl'. com/mysema/codegen/model/Type (0) | 2022.07.07 |
| [Git] refusing to merge unrelated histories (0) | 2022.05.13 |