08-Dec-2021 12:08:06.572 Warning [RMI TCP Connection(3)-127.0.0.1] org.springframework.web.servlet.DispatcherServlet.initServletBean Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘employeeController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.lyq.ssm.service.EmployeeService com.lyq.ssm.controller.EmployeeController.employeeService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘employeeService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.lyq.ssm.dao.EmployeeMapper com.lyq.ssm.service.EmployeeService.employeeMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.lyq.ssm.dao.EmployeeMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:292)
1.Scanning whether the annotation is open
Opened
<context:component-scan base-package="com.lyq.ssm">
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"></context:exclude-filter>
</context:component-scan>
2. Whether spring listener is configured
if it is not configured:
<!--Configure spring's listener to load only the files in the WEB-INFO directory by default-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
After the configuration is completed, it runs successfully
Read More:
- Error creating bean with name ‘adminMapper‘ Injection of resource dependencies failed
- [Solved] Rabbitmq injection failed, bean creation failed, error creating bean with name ‘rabbitconnectionfactory’‘
- [Solved] org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘xxx‘
- [Solved] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name
- [Solved] Error creating bean with name ‘accountService‘: Unsatisfied dependency expressed through field
- [Solved] BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘
- Spring Project Error: Error creating bean with name [How to Solve]
- [Solved] Error creating bean with name ‘org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0‘:
- Springboot integration shiro error: UnsatisfiedDependencyException: Error creating bean with name ‘getShiroFilterFact
- [Solved] Spring AOP Error creating bean with name
- springboot Integrate mybatis Error: Error creating bean with name ‘deptController‘: Unsatisfied dependency expresse
- [Solved] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org
- [Solved] Error creating bean with name ‘fileVisitController‘ defined in file
- [Solved] BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:
- JPA multiple-data source startup error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘t
- Error creating bean with name [How to Solve]
- [Solved] Error creating bean with name ‘mappingJackson2HttpMessageConverter‘ defined in class path resource
- [Solved] Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource…
- [Solved] Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource…
- [Solved] Arthas failed to bind telnet or http port! Telnet port: 3658, http port: 8563;Error creating bean