2

I am getting below error after updating spring-boot starter parent to 2.4.3. But after setting up server.servlet.register-default-servlet=true application is working as expected. But one i would like to know is, in the reference spring documentation >Spring Boot 2.4 will no longer register the DefaultServlet provided by your servlet container. In most applications, it isn’t used since the Spring MVC’s DispatcherServlet is the only servlet that’s required. So do i missing anything as my application is not considering DispatcherServlet as default one

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultServletHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'defaultServletHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: Unable to locate the default servlet for serving static content. Please set the 'defaultServletName' property explicitly. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)

krishna
  • 41
  • 4

0 Answers0