<bean id="feeCodeSogouConfig"
class="com.sech.zengzhi.service.config.FeeCodeSogouConfig">
<constructor-arg>
<ref bean="userService" />
<ref local="searchDataService" />
</property>
<property name="sysConfig">
<ref local="sysConfig" />
</property>
class="com.sech.zengzhi.service.config.FeeCodeSogouConfig">
<constructor-arg>
<ref bean="userService" />
</constructor-arg>
<constructor-arg>
<ref bean="advertisingService" />
</constructor-arg>
<ref local="searchDataService" />
</property>
<property name="sysConfig">
<ref local="sysConfig" />
</property>
</bean>
错误信息: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)
原因是
构造函数写错了..注入的时候找不到构造函数public FeeCodeSogouConfig(UserService userService,AdvertisingService advertisingService) { logger.debug("initializes...."); this.userService = userService; this.advertisingService=advertisingService; this.loadUserCodes(); }加上红色的问题解决
作者:qdgengwenfei 发表于2013-1-14 16:39:06 原文链接
阅读:25 评论:0 查看评论