inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술

단순하고 실용적인 컨트롤러 - v4

갑작스런 오류..;

12582

작성자 없음

작성한 질문수 0

0

v3까지 잘 작동되다가 v4부터
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
라는 오류가 뜨면서 서버가 안켜집니다 ㅠ
자바11, 인텔리제이 재설치도 해보고 구글링도 다 해봤는데 고쳐지질 않아서 이전 프로젝트 실행해보니 이건 잘됐고 강의자료에 있는 프로젝트도 시도해보니 안되네요.. 어떻게 해야 고칠 수 있을까요 ㅠ

MVC spring

답변 1

0

David

안녕하세요. aut님, 공식 서포터즈 David입니다.

에러 전체 내용을 캡쳐해서 올려주시면 답변에 큰 도움이 됩니다.

감사합니다.

0

aut

퇴근해서 바로 캡쳐하겠습니다!

0

aut

 .   ____          _            __ _ _

 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \

( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \

 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )

  '  |____| .__|_| |_|_| |_\__, | / / / /

 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v2.4.3)

 

2022-05-23 20:02:39.866  INFO 12056 --- [           main] hello.servlet.ServletApplication         : Starting ServletApplication using Java 11.0.13 on DESKTOP-K3OI6KP with PID 12056 (C:\Users\tom\Downloads\springmvc1-v2020-03-08\servlet\out\production\classes started by tom in C:\Users\tom\Downloads\springmvc1-v2020-03-08\servlet)

2022-05-23 20:02:39.866  INFO 12056 --- [           main] hello.servlet.ServletApplication         : No active profile set, falling back to default profiles: default

2022-05-23 20:02:40.430  WARN 12056 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: 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

2022-05-23 20:02:40.445  INFO 12056 --- [           main] ConditionEvaluationReportLoggingListener : 

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2022-05-23 20:02:40.461 ERROR 12056 --- [           main] o.s.boot.SpringApplication               : Application run failed

 

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

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:196) ~[spring-context-5.3.4.jar:5.3.4]

at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:745) ~[spring-context-5.3.4.jar:5.3.4]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:563) ~[spring-context-5.3.4.jar:5.3.4]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.3.jar:2.4.3]

at hello.servlet.ServletApplication.main(ServletApplication.java:12) ~[classes/:na]

Caused by: java.lang.NoClassDefFoundError: javax/servlet/annotation/WebServlet

at org.springframework.boot.web.servlet.WebServletHandler.<init>(WebServletHandler.java:39) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.web.servlet.ServletComponentRegisteringPostProcessor.<clinit>(ServletComponentRegisteringPostProcessor.java:49) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.boot.web.servlet.ServletComponentScanRegistrar$ServletComponentRegisteringPostProcessorBeanDefinition.lambda$getInstanceSupplier$0(ServletComponentScanRegistrar.java:94) ~[spring-boot-2.4.3.jar:2.4.3]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1231) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1173) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.4.jar:5.3.4]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.4.jar:5.3.4]

... 14 common frames omitted

Caused by: java.lang.ClassNotFoundException: javax.servlet.annotation.WebServlet

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[na:na]

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]

... 21 common frames omitted

 

 

Process finished with exit code 1

에러 내용 캡쳐입니다

0

David

아래 글 답변을 참고한 뒤 다시 시도해보시겠어요?

https://www.inflearn.com/questions/172527

0

aut

어제 저렇게 했었는데도 안됬는데 오늘은 되네요 감사합니다ㅠ

0

loinse bekean

나는 당신의 링크를 통해 그것을 만들었습니다. 매우 감사합니다

drive mad

servlet과 container에 대한 질문입니다

0

25

1

api를 어느 컨트롤러에 작성해야하는지는 어떤 기준으로 해야하나요?

0

64

1

jsp 의존성 수정 요청

0

80

2

요즘 웹 서버가 주로 사용되는 이유는 SPA 구조 때문일까요 ?

0

143

1

save() 메서드 문의

0

67

1

절대 경로로 templates/basic 하위 파일 열면 css 적용 안되는 현상

0

101

1

request-body-json

0

83

2

MVC 패턴의 적용 단위

0

97

1

RequestMapping을 이용한 핸들러, 어댑터

0

119

2

save 후 결과화면

0

89

2

jsp를 이용한 view

0

97

1

application.properties에 debug 추가해도 결과가 똑같습니다.

0

178

1

수업 코드 제공 관련 문의

0

97

2

RequestMappingHandlerAdapter의 Controller 호출 과정

0

100

3

파일 오픈 시

0

70

1

스프링 배치 관련

0

78

1

@RequestParam의 defaultValue가 blank 값도 처리하는 지 여부

0

112

1

postman으로 /request-body-json-v1 호출시 500 error

0

96

1

프론트엔드와 백엔드의 mvc, rest api에 대한 질문

0

79

1

모델의 역할과 계층 분리에 대한 이해 차이 + 추가질문

0

111

1

console log 출력 관련 질문입니다.

0

75

1

애플리케이션이 실행 되지 않습니다 ㅠㅠㅠ

0

139

1

html 변경하는 부분 적용 문제

0

103

1

한글 깨짐

0

77

2