When I was working on the 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, I found that the console kept outputting errors, as shown in the figure
I don't know why, then I'm going to debug the source code and enter MybatisAutoConfiguration.java
The place where the line is drawn is the place where the error occurs. A blank pointer is reported. What are these properties?
@Autowiredprivate MybatisProperties properties;
This class is injected from spring, so what is this class for and when is it injected? Let's take a look at the structure of this class first
This is to read the configuration about mybatis in our application.yml/properties.
Why can't the configuration be read? All were good before. It's guess that it's the devtool, just remove the dependencies.
Summarize
The above is the error of mybatis reporting circular dependency when springboot is started (recommended). I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!