Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.

09-Jul-2018 23:02:37.393 信息 [http-nio-8080-exec-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'SpringMVC'
09-Jul-2018 23:02:38.319 严重 [http-nio-8080-exec-1] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userLoginController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.search.service.face.UserLoginService com.search.controller.UserLoginController.userLoginService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserLoginServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.search.dao.face.UserLoginDAO com.search.service.serviceimpl.UserLoginServiceImpl.UserLoginDAO; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.search.dao.face.UserLoginDAO] 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)}
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userLoginDAO' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\com\search\dao\face\UserLoginDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sessionFactoryBean' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\spring\spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryBean' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\spring\spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userLoginDAO' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\com\search\dao\face\UserLoginDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : Error creating bean with name 'sessionFactoryBean' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\spring\spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryBean' defined in file [D:\Java\ApacheTomcat-9.0.8-windows-x64\apache-tomcat-9.0.8\webapps\ROOT\WEB-INF\classes\spring\spring-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(A

utowiredAnnotationBeanPostProcessor.java:334)

业务接口

业务实现层

 

控制层

简单说下注解

  1、DAO层注解@Repository  

 2、Controller层注解@Controller

 3、Service层注解@Service

4   @Component组件注解

 

网上找了很多资料多有

         1、web.xml文档的配置不对,

         2、 bean配置的不正确或漏掉,

         3、@Service注解使用不当的或漏掉

我这个是maven的pom.xml配置的时候少了一些扎包和插件类,造成冲突和依赖不够。

 

 
供参考....

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值