English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Spring Boot Start-up Error of Circular Dependency in Mybatis (Recommended)

When I was working on a project, I wanted to use hot deployment to reduce deployment time, so I added springboot-devtools

Added dependency in Maven

<dependency>
    <groupId>org.springframework.boot</<groupId>
   <artifactId>spring-boot-devtools</artifactId>
</dependency>

Then, when starting the project normally, the console kept outputting errors continuously, as shown in the figure

Don't understand, so I'm ready to debug the source code, and I entered MybatisAutoConfiguration.java

The underlined part is where the error occurred, reported as a null pointer, what is the properties here

@Autowired
private MybatisProperties properties;

This class is injected from spring, so what does this class do, and when is it injected? Let's first look at the structure of this class

This is reading from our application.yml/There are configurations related to mybatis in properties.

Why can't the configuration be read? It was good before. Guess it's the devil of devtool, and it's fixed after removing the dependency.

Summary

The above is the error of circular dependency reported by mybatis at startup time of springboot introduced by the editor to everyone, hoping it will be helpful to everyone. If you have any questions, please leave a message, and the editor will reply to everyone in time. Here, I also want to express my heartfelt thanks to everyone for their support of the Yell Tutorial website!

Declaration: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#w3Please report via email to codebox.com (replace # with @) when reporting, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.

You May Also Like