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