读书人

多个数据源 JUnit Test 报差错理 No

发布时间: 2012-10-08 19:54:56 作者: rapoo

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

读书人网 >SQL Server

热点推荐