Common errors in Maven+spring+springmvc+mybatis

Source: Internet
Author: User
Tags manage connection

1Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Useremailcontroller ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateCom.wf.emailservice.backend.service.core.IUserEmailService Com.wf.emailservice.backend.web.controller.UserEmailController.userEmailService; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Useremailservice ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateCom.wf.emailservice.backend.service.core.IVivofsService Com.wf.emailservice.backend.service.core.impl.UserEmailService.vivofsService; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Vivofsservice ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateOrg.apache.http.impl.client.CloseableHttpClient Com.wf.emailservice.backend.service.core.impl.VivofsService.httpClient; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [ Org.apache.http.impl.client.CloseableHttpClient] Found fordependency:expected at least 1 bean which qualifies as Autowire candidate for  ThisDependency. Dependency annotations: {@org. springframework.beans.factory.annotation.Autowired (required=true)}

Error form one: No qualifying bean of type [org.apache.http.impl.client.CloseableHttpClient] cannot find the corresponding bean

1   for  for  this dependency. Dependency annotations: {@org. springframework.beans.factory.annotation.Autowired (required=true)}
View Code
1Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Useremailcontroller ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateCom.vivo.emailservice.backend.service.core.IUserEmailService Com.vivo.emailservice.backend.web.controller.UserEmailController.userEmailService; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Useremailservice ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateCom.vivo.emailservice.backend.service.core.IVivofsService Com.vivo.emailservice.backend.service.core.impl.UserEmailService.vivofsService; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Vivofsservice ': Injection of autowired dependencies failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Could not autowire field:PrivateOrg.apache.http.impl.client.CloseableHttpClient Com.vivo.emailservice.backend.service.core.impl.VivofsService.httpClient; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type [ Org.apache.http.impl.client.CloseableHttpClient] Found fordependency:expected at least 1 bean which qualifies as Autowire candidate for  ThisDependency. Dependency annotations: {@org. springframework.beans.factory.annotation.Autowired (required=true)}

The main reason for this is the lack of httpclient configuration files

1<?xml version= "1.0" encoding= "UTF-8"?>2<beans xmlns= "Http://www.springframework.org/schema/beans"3Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"4Xsi:schemalocation= "Http://www.springframework.org/schema/beans5http//www.springframework.org/schema/beans/spring-beans.xsd ">6 7<!--Manage Connection pools--8<bean id= "Httpclientconnectionmanager"class= "Org.apache.http.impl.conn.PoolingHttpClientConnectionManager"9destroy-method= "Close" >Ten<property name= "maxtotal" value= "/>" One<!--The default maximum number of connections to the target host- A<property name= "Defaultmaxperroute" value= "/>" -</bean> -  the<!--httpclient Factory-- -<bean id= "Httpclientbuilder"class= "Org.apache.http.impl.client.HttpClientBuilder" > -<property name= "ConnectionManager" ref= "Httpclientconnectionmanager"/> -</bean> +  -<!--httpclient objects-- +<bean id= "httpClient" factory-bean= "Httpclientbuilder" factory-method= "Build" scope= "prototype" > A</bean> at  -<!--request Configuration Factory-- -<bean id= "Requestconfigbuilder"class= "Org.apache.http.client.config.RequestConfig.Builder" > -<!--the time-out for HTTP connections-- -<property name= "connecttimeout" value= "/>" -<!--time-out to pick up connections from the connection pool- in<property name= "Connectionrequesttimeout" value= "ten"/> -<!--timeout to wait for response data-- to<property name= "sockettimeout" value= "/>" +</bean> -  the<!--Request Configuration Objects-- *<bean id= "Requestconfig" factory-bean= "Requestconfigbuilder" factory-method= "Build" > $</bean>Panax Notoginseng  -  the</beans>

Common errors in Maven+spring+springmvc+mybatis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.