多个数据源 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"
};
}
}

你可能感兴趣的:(Java)