Project scenario:
SpringBoot project, unable to create bean object, unable to inject dependencies
Problem Description:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'adminService':
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
'adminMapper' defined in file [E:\IdeaCode\toyrentalplatform\target\classes\cn\gestwr\toy\dao\AdminMapper.class]: Unsatisfied dependency expressed through bean property
'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException:
Cause Analysis:
After many times of querying Baidu, Stack Overflow, and self-inspection, it was finally found that it was a problem with the configuration file application.properties
solution:
The configuration file configuration option is wrong, for example: the following configuration is added and an error is reportedmybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
In the properties file, the color of this configuration is different from that of other configurations, the correct one is light green
I don't know the reason for the time being, if you know the big guy, you can comment and let me know -0-
Pay attention to the format of the yml configuration file