servlet.service() for servlet [dispatcherservlet] in context with path [] th

.Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost/8081:user/1": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect] with root cause java.net.ConnectException: Connection refused: connect

Is it because: Servlet.service service (for servlet [DispatcherServlet] in context with path [], exception [Request processing failed; nested exception is java.lang.NullPointerException] has a root cause

 

reason:

The description is an error caused by the above url (the url may not exist, and the redirected url may conflict with the root path of the web project (usually the project name));

So check if your url is paired.
Another solution: start class configuration package scanning so that the beans under the common package can be scanned.

@SpringBootApplication(scanBasePackages = {"com.suntang.common","com.suntang.login"})

Guess you like

Origin blog.csdn.net/yetaodiao/article/details/130867938