Project scenario:
springboot project, unable to create bean object and inject dependency
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:
It is the configuration file application Properties
Solution:
the configuration options of the configuration file are wrong, for example, the following configuration is added and an error is reported
mybatis.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
Note the format of the YML configuration file
Read More:
- [Solved] ssm Error: Error creating bean with name ‘employeeController’: Injection of autowired dependencies failed
- [Solved] Rabbitmq injection failed, bean creation failed, error creating bean with name ‘rabbitconnectionfactory’‘
- [Solved] Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource…
- [Solved] Error creating bean with name ‘mappingJackson2HttpMessageConverter‘ defined in class path resource
- Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource
- [Solved] Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource…
- [Solved] Springboot Error: Error creating bean with name ‘dataSource‘ defined in class path resource
- [Solved] seata:Error creating bean with name ‘globalTransactionScanner‘ defined in class path resource
- [Solved] Error creating bean with name ‘entityManagerFactory‘ defined in class path resource
- [Solved] springCloud Startup Error: Error creating bean with name ‘defaultValidator‘ defined in class path resource
- [Solved] RabbitMQ Error: Error creating bean with name ‘rabbitConnectionFactory‘ defined in class path resource
- SpringBoot integrates Es error: Error creating bean with name ‘restHighLevelClient‘ defined in class path resource
- [Solved] Error creating bean with name ‘sqlSessionFactory‘ defined in class path resource
- [Solved] Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource
- jasypt springboot Error: Error creating bean with name ‘enableEncryptablePropertySourcesPostProcessor’ defined in class path resource
- [Solved] BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘
- [Solved] Error creating bean with name ‘fileVisitController‘ defined in file
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- [Solved] Error creating bean with name ‘accountService‘: Unsatisfied dependency expressed through field
- [Solved] org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxx‘