Spring Framework Exception Encyclopedia

Abnormal Encyclopedia

exception class name explain
NoSuchBeanDefinitionException There is no such bean in the Spring container, but trying to obtain (probably Spring automatically obtains)/use this bean
NoUniqueBeanDefinitionException When trying to get a bean by type, because there are multiple beans of this type in the Spring container, an error occurs
SQLIntegrityConstraintViolationException SQL constraint exception, usually the data you try to write violates the constraints when creating the data table
BindingException If the exception prompt information is displayed Invalid bound statement (not found), it is because the abstract method does not find the corresponding SQL configuration when using Mybatis. The exception prompt information will also show which method does not have a corresponding SQL configuration. You should check the XML corresponding to this abstract method. Configuration, even check the related configuration of mapperLocations
BuilderException If the abnormal prompt information is displayed Parse xml error, it means that there is a syntax error in an XML file. At the same time, you can also find out which XML syntax error is in the prompt information, check the corresponding XML file and troubleshoot the error.
SQLSyntaxErrorException nearThe SQL syntax error will contain words in the prompt information , and it will prompt which fragment of the SQL statement has an error near it.
TooManyResultsException When using Mybatis, there may be more than one result of the query, but the return value type declared by the abstract method is not of the List collection type
MalformedInputException .ymlThe syntax error of the configuration file used in Spring Boot, usually, may be an obvious syntax error itself, or it may be that the encoding of some characters cannot be recognized due to copying the code. You can try to check the recently added code, or re- Write the most recently added code, or even delete all the code in the configuration file and recode it (try opening the configuration file with notepad, copy the code, and then paste it back in yml)

Guess you like

Origin blog.csdn.net/gezongbo/article/details/126264091