在尝试使用Spring的Test的时候遇到了这个错误

原来的代码:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"../../../resources/config/spring.xml"})
public class TestFund { @Autowired
private FundService fundService; @Test
public void testFundSelectAll() {
//System.out.println("所有基金: " + fundService.selectAll());
System.out.println(fundService);
}
}

原因分析:

  修改spring的配置文件spring.xml的位置

解决方法:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:config/spring.xml")
public class TestFund { @Autowired
private FundService fundService; @Test
public void testFundSelectAll() {
//System.out.println("所有基金: " + fundService.selectAll());
System.out.println(fundService);
}
}

问题解决!

最新文章

  1. android 控件在不同状态下的内容样式与背景样式
  2. 使用JFinal的第一个项目出现的问题(The return type is incompatible with JspSourceDependent.getDependants())
  3. 【BZOJ-1858】序列操作 线段树
  4. 初始Jquery--以及工厂函数
  5. Java 第五天 Spring IOC 配置文件
  6. 让UITableViewCell的分隔线宽度等于屏幕的宽度
  7. jQuery中的supersized的插件的功能描述
  8. java--socket实现一个client像还有一个client发送信息
  9. 矩阵类c++实现
  10. centos 把网卡名称修改为 eth0
  11. ASP.NET Core 依赖注入
  12. c/c++ 基本线程管理 join detach
  13. [STM32F103]外部中断
  14. 从MongoDB里面取得json格式的数据,然后存为本地的json文件,然后再从json读取变为dict
  15. MANIPULATION
  16. jsp页面跳转页面的几中方式(同步更新)
  17. 程序员面试50题—sizeof的用法(6)
  18. 【暴力Treap 或 离线归并】子串计数(genies)
  19. ecshop安装
  20. 4-14-17 JavaScript知识点总结(包括JOSN, ajax等,来源w3c)

热门文章

  1. XML--XML Schema Definition(一)
  2. js.console携程近期低价机票信息
  3. 201771010123汪慧和《面向对象程序设计JAVA》第六周实验总结
  4. dbus探索
  5. UVA 10806 最小费用最大流
  6. solr集群的搭建
  7. 201403-2 窗口 Java
  8. MVC的异步模式
  9. Android json数据Log格式化打印
  10. Properties in Algebra