Startup class error (IllegalStateException) :

A:



Cause: The corresponding SpringBoot project startup class was not found during unit test startup

Solution:

No classes are defined in the SpringBoot project and the boot classes are not described using the @SpringBootApplication annotation



The unit test class is not in the package or subpackage in which the starter class resides

2:



Reason: There may be multiple boot classes in the Sprigboot project…

Solution:Delete the package in which its startup classes are located and keep one extra startup class in its subpackages.

Mybatis error:

A:



Reason: access property or call property is NULL

Solution:



Check if the test class is managed by the Spring container, has the @SpringBoottest annotation, or is under the test package

Check if the property is dependent injected by Spring (add @Autowired annotation)



Is the @Test annotation introduced correctly on the unit Test method



Reason: Usually the object does not exist

Solution: Run it first. If there is no problem in running it, it is a tool (IDEA) problem, which does not affect the operation of the program. Otherwise, add @Mapper annotation in the Mapper layer

SpringWeb error:

404 (request page does not exist)



Cause: The service did not start, the port is not correct

Check if the requested URL is correct.

Check whether the requested resource is managed by Spring,

Check that the port is correct

The server encountered an error and could not complete the request.

The reason:

Server error, etc.

Solution: Restart the server, etc…

Three: 400 (server does not understand the syntax of the request)



Reason: When the client submitted the number of request parameters, type. A format mismatch is a 404

Solution: check the type, number, such as the date of submission to the server

Four: 405 (Disable the method specified in the request)



Reason: The client commits in a way that does not match the handler defined by the server

Solution: Check the way the request is handled, such that the service can only be handled with GET requests, not POST requests