인프런 커뮤니티 질문&답변

작성자 없음

작성자 정보가 삭제된 글입니다.

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

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

갑작스런 오류..;

작성

·

12K

0

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

답변 1

0

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

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

감사합니다.

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

 .   ____          _            __ _ _

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

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

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

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

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

 :: 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

에러 내용 캡쳐입니다

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

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

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

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

drive mad

작성자 없음

작성자 정보가 삭제된 글입니다.

질문하기