分配置文件在classpath下和web-inf下两种情况的加载: ApplicationContext context = new FileSystemXmlApplicationContext("WebRoot/WEB-INF/applicationContext.xml"); new ClassPathXmlApplicationContext("applicationContext.xml");// 从classpath中加载 new FileSystemX…
junit加载pom引用项目的xml配置文件,如果定义了<beans profile="dev">,必须在测试用例类上面加上标记 @ActiveProfiles("product"),否则spring找不到<beans profile="dev">里面的配置.提示错误信息: No bean named '*Mongo' is defined…