개발/공부

[SpringBoot/오류] Description:Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context.

할루솔이 2023. 12. 27. 17:25
반응형

어제까지 잘 돌아가던 프로젝트가 오늘 다시 구동하니 이런 오류가 생겼다.

 

Description:

Web application could not be started as there was no org.springframework.boot.web.servlet.server.ServletWebServerFactory bean defined in the context.

 

Action:

Check your application's dependencies for a supported servlet web server.

Check the configured web application type.

 

 

 

 

왜 갑자기 안되는거지???????

 

 

 

열심히 구글링을 해보니

1. @SpringBootApplication 이 없는 경우

 

난 있다...

 

 

2. dependencies에 spring-boot-starter-web이 없는 경우

 

잘 들어가있다...ㅋㅋㅋㅋㅋㅋ

 

 

좀 더 찾아보니까 깃허브에 올리고 나면 이런 오류가 발생할 수 있다고 한다!!

내가 해결한 방법은

 

1. gradle reload

2. gardle refrash

 

 

프로젝트 우측 코끼리를 누르면 Gradle 탭을 열 수 있다.

빨간 동그라미 친 부분을 클릭하면 reload가 되고,

우클릭을 하면 refrash gradle dependencies가 있다!

 

혹시 몰라서 둘 다 실행하고 다시 구동하니 오류 없이 잘 돌아간다!

 

오류 해결!

 

 

 

 

 

반응형