[error] javax.servlet.ServletException: No adapter for handler SpringBoot
✅ 에러 메세지
javax.servlet.ServletException: No adapter for handler SpringBoot
No adapter for handler [com.FlagHome.backend.v1.category.controller.CategoryController@36a848f7]: The DispatcherServlet configuration needs to include a HandlerAdapter that supports this handler
at org.springframework.web.servlet.DispatcherServlet.getHandlerAdapter(DispatcherServlet.java:1305) ~[spring-webmvc-5.3.22.jar:5.3.22]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1053) ~[spring-webmvc-5.3.22.jar:5.3.22]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.22.jar:5.3.22]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.22.jar:5.3.22]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) ~[spring-webmvc-5.3.22.jar:5.3.22]
✅ 해결 방법
RestController에 지정하던 Url 경로를 @RequestMapping으로 빼준다.
@RestController("/v1/categories")
public class CategoryController {
@RestController
@RequestMapping("/v1/categories")
public class CategoryController {
참고자료