Spring Dependency Injection (hint:specify index and/or type arguments for simple parameters to avoid type Ambiguiti)

Source: Internet
Author: User
Tags constructor
<bean id= "Feecodesogouconfig"
class= "Com.sech.zengzhi.service.config.FeeCodeSogouConfig" >
<constructor-arg>
<ref bean= "UserService"/>

</constructor-arg>

<constructor-arg>
<ref bean= "Advertisingservice"/>
</constructor-arg>
<property name= "Searchdataservice" >
<ref local= "Searchdataservice"/>
</property>
<property name= "SysConfig" >
<ref local= "SysConfig"/>
</property>

</bean>


Error message: 16:37:18,109 error Contextloader:205-context initialization failed
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' Feecodesogouconfig '
defined in ServletContext resource [/web-inf/applicationcontext.xml]: 2 constructor arguments specified but no
Matching constructor found in bean ' feecodesogouconfig '
(hint:specify index and/or type arguments for simple parameters to avoid type ambiguities)


Reason is

The constructor is incorrectly written. The constructor was not found when injected
Public Feecodesogouconfig (UserService userservice,advertisingservice advertisingservice) {
		Logger.debug (" Initializes ... ");
		This.userservice = UserService;
		This.advertisingservice=advertisingservice;
		This.loadusercodes ();
}
Plus the red problem solved

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.