当前位置: 代码迷 >> SQL >> 多个数据源 JUnit Test 报差错理 No unique bean of type [javax.sql.DataSource]
  详细解决方案

多个数据源 JUnit Test 报差错理 No unique bean of type [javax.sql.DataSource]

热度:376   发布时间:2016-05-05 13:20:36.0
多个数据源 JUnit Test 报错处理 No unique bean of type [javax.sql.DataSource]
ssh多数据源报错处理方法
No unique bean of type [javax.sql.DataSource]
setAutowireMode(AUTOWIRE_BY_NAME); 按名称找


import org.apache.commons.logging.Log;import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;public abstract class BaseActionTestCase extends AbstractTransactionalDataSourceSpringContextTests  {	 protected transient final Log log = logger;	 	 protected String[] getConfigLocations() {	        super.setAutowireMode(AUTOWIRE_BY_NAME);	        return new String[] {	        		"classpath:/config/spring_cfg/appCtx-*.xml",	        			                "classpath:/config/struts_cfg/struts-*.xml",	                "classpath:org/codehaus/xfire/spring/xfire.xml"	               };	    }}
  相关解决方案