Hello Team, I am using spring version 4.3.1 ,i am facing problem while using spring ,Kindly provide solution for the problem
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.http.HttpHost#1a451d4d' defined in class path resource [spring/context-dao.xml]: Unsatisfied dependency expressed through constructor parameter 1: Ambiguous argument values for parameter of type [int] - did you specify the correct bean references as arguments?
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:736)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
... 23 more
Related cause:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.http.HttpHost#1a451d4d' defined in class path resource [spring/context-dao.xml]: Unsatisfied dependency expressed through constructor parameter 0: Ambiguous argument values for parameter of type [java.net.InetAddress] - did you specify the correct bean references as arguments?
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:736)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
================================================================ my XML file is:-
<bean id="syncGatewayAdminRestTemplate" parent="parentRestTemplate">
<property name="requestFactory">
<bean class="com.bureauveritas.summer.http.client.HttpComponentsClientHttpRequestFactoryBasicAuthentication">
<constructor-arg>
<bean class="org.apache.http.HttpHost">
<constructor-arg index="0" type="java.lang.String" value="${detention.syncgateway.admin_api.hostname}" />
<constructor-arg index="1" type="int" value="${detention.syncgateway.admin_api.port}" />
<constructor-arg index="2" type="java.lang.String" value="${detention.syncgateway.admin_api.scheme}" />
</bean>
</constructor-arg>
Comment From: sunil-kumarBV
i uplaoded the xml file
Comment From: sunil-kumarBV
i am attaching the xml file.
Comment From: mdeinum
Questions are better to be asked through StackOverflow then in the Github issue tracker.
Comment From: rstoyanchev
I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.
Comment From: rstoyanchev
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.