tags: Spring MVC
When I was working on Spring related projects, I was stuck with this bug for a long time. I found a lot of other people’s blogs on the Internet, and several browsers were opened... I was looking for help from the team leader when I was unable to find it. Assigned a null initial value such as:
List<TermAllRes> termAllResList = null;
Should be changed to:
List<TermAllRes> termAllResList = new ArrayList<TermAllRes>();
Of course, everyone’s bugs are different. Below I will give some examples of common solutions. There should be a solution:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Note: This package is used for health monitoring.
ps: In fact, the official documentation is also pitted. It may have been developed from the beginning to the present. Some omissions in the documentation have caused some packages to be introduced and not cleared, and even the official sample code is not explained. The above problem appears
Possible reason: compilation error
Solution:
mvn clean
mvn package
Wrong words for page related attributes
Temporarily turn off the search engine server ElasticSearch
The service layer implementation class does not add the annotation @Autowired.
The function of @Autowired is to automatically inject dependent beans.
Modification method:
add comment
Delete all the antlr folders in the path .m2\repository\
Then re-use Maven update project
Serialization exception
Solution: serialize pojo

The exception is caused by the conflict between response.getOutputStream() and response.getWriter(), or the last used information has not been cleared, so the cache needs to be reset.
Solution: add response.resetBuffer(); before use
Critical: Servlet.service() for servlet dispatcherServlet threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:610)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:198)
In a Controller, new but not a Controller is ok; then call a service and an error is reported
Finally, change the new object to injection

ps: When working on a project, we will always encounter bugs. We should face it calmly. Every time we solve a bug, we have a sense of accomplishment! This is the precipitation of knowledge!
Learning is like rowing upstream
problem: solution: Change the path in .m2\repository\antlr Delete all folders Then re-use Mavenupdate project...
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.StringUtil...
Do todayspring-mvcThere was an error, showing that it could not be foundspringUnder the frameutilPackagedStringUtilsTools inmatchesCharactermethod. Error display wrong reason Check the code and there ...
Look at the access path is not a "/" Then you have to do it is to eliminate the comments used by SpringBoot. You can refer to this big blog: If you can't solve it, then if you see if your HT...
2021-05-25 13:08:29.219 ERROR 17508 — [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Circula...
Question: Servlet.service () for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Er...
First report error Here, Jedis error is displayed, and it is a Java and Redis connection error. There are several problems here: My redis is installed on the server, so the Host's port address should ...
In this error, I have an error in Mapper.xml in the data connection: Above the code<resultMap id="???">Id value needs and below<resultmap="???">One-to-one...
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Could not resolve view with name 'employee/login' in servlet with name 'dispatcherServlet'] with root cause R...
1. Error Process: Report an error after deleting a picture resource during the project test: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processi...