** Я пытался решить эту проблему более чем за пару часов, но не смог: «У меня есть простое mvc приложение в java весенней загрузке, когда я запускаю программу, она говорит следующее сообщение об ошибке», так что шаги, чтобы избавиться от этого массажа, я попытался, добавив компонентное сканирование в приложении. java, но это не сработало **
2020-03-02 10:19:17.510 INFO 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 3 ms
2020-03-02 10:19:17.516 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : GET "/Registration", parameters={}
2020-03-02 10:19:17.519 DEBUG 16708 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.rohit.flightreservation.controller.UserController#ShowRegistration()
2020-03-02 10:19:17.533 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.9, */*;q=0.8]
2020-03-02 10:19:17.533 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.servlet.view.InternalResourceView : View name 'login/registration', model {}
2020-03-02 10:19:17.534 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.servlet.view.InternalResourceView : Forwarding to [login/registration]
2020-03-02 10:19:17.536 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : "FORWARD" dispatch for GET "/login/registration", parameters={}
2020-03-02 10:19:17.538 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2020-03-02 10:19:17.539 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found
2020-03-02 10:19:17.539 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Exiting from "FORWARD" dispatch, status 404
2020-03-02 10:19:17.540 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2020-03-02 10:19:17.540 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={}
2020-03-02 10:19:17.540 DEBUG 16708 --- [nio-8080-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2020-03-02 10:19:17.545 DEBUG 16708 --- [nio-8080-exec-1] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2020-03-02 10:19:17.549 DEBUG 16708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404
2020-03-02 10:19:18.319 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : GET "/Registration", parameters={}
2020-03-02 10:19:18.319 DEBUG 16708 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.rohit.flightreservation.controller.UserController#ShowRegistration()
2020-03-02 10:19:18.320 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.9, */*;q=0.8]
2020-03-02 10:19:18.320 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.servlet.view.InternalResourceView : View name 'login/registration', model {}
2020-03-02 10:19:18.320 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.servlet.view.InternalResourceView : Forwarding to [login/registration]
2020-03-02 10:19:18.320 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : "FORWARD" dispatch for GET "/login/registration", parameters={}
2020-03-02 10:19:18.320 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2020-03-02 10:19:18.321 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found
2020-03-02 10:19:18.321 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Exiting from "FORWARD" dispatch, status 404
2020-03-02 10:19:18.321 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2020-03-02 10:19:18.321 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={}
2020-03-02 10:19:18.322 DEBUG 16708 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2020-03-02 10:19:18.323 DEBUG 16708 --- [nio-8080-exec-2] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2020-03-02 10:19:18.323 DEBUG 16708 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404
2020-03-02 10:19:18.499 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : GET "/Registration", parameters={}
2020-03-02 10:19:18.500 DEBUG 16708 --- [nio-8080-exec-4] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.rohit.flightreservation.controller.UserController#ShowRegistration()
2020-03-02 10:19:18.501 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.9, */*;q=0.8]
2020-03-02 10:19:18.501 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.servlet.view.InternalResourceView : View name 'login/registration', model {}
2020-03-02 10:19:18.501 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.servlet.view.InternalResourceView : Forwarding to [login/registration]
2020-03-02 10:19:18.501 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : "FORWARD" dispatch for GET "/login/registration", parameters={}
2020-03-02 10:19:18.502 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
2020-03-02 10:19:18.503 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found
2020-03-02 10:19:18.503 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : Exiting from "FORWARD" dispatch, status 404
2020-03-02 10:19:18.503 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
2020-03-02 10:19:18.503 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={}
2020-03-02 10:19:18.504 DEBUG 16708 --- [nio-8080-exec-4] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#errorHtml(HttpServletRequest, HttpServletResponse)
2020-03-02 10:19:18.505 DEBUG 16708 --- [nio-8080-exec-4] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, text/html;q=0.8]
2020-03-02 10:19:18.505 DEBUG 16708 --- [nio-8080-exec-4] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404
мой контроллер здесь
package com.rohit.flightreservation.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class UserController {
@RequestMapping ("/Registration")
public ModelAndView ShowRegistration() {
ModelAndView modelAndView=new ModelAndView();
modelAndView.setViewName("login/registration");
return modelAndView;
}
}
А вот мое заявление
package com.rohit.flightreservation;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class FlightreservationApplication {
public static void main(String[] args) {
SpringApplication.run(FlightreservationApplication.class, args);
}
}