Spring4.3.8使用单元测试报错
来源:互联网 发布:淘宝首页海报怎么做 编辑:程序博客网 时间:2024/05/22 05:15
1.添加junit-4.8.2.jar,测试出现问题报错java.lang.noclassdeffounderror:org/apache/commons/logging/LogFactory,查询发现是缺少支持jar,添加支持commons-logging-1.1.3.jar
2.继续报错需要junit-4.12以上
3.添加支持junit-4.12.jar
4.运行继续报错,java.lang.noclassdeffounderror:org/hamcrest/SelfDescribing
终极解决,查询发现:
junit.jar: Includes the Hamcrest classes. The simple all-in-one solution to get started quickly.Starting with version 4.11, Hamcrest is no longer included in this jar.
junit-dep.jar: Only includes the JUnit classes but not Hamcrest. Lets you use a different Hamcrest version.
说明4.11中没有hamcrest包了
最好的解决方法是:
使用是导入包的方案:junit.jar + hamcrest-core.jar + hamcrest-library.jar
分别下载所用jar,hamcrest-core-1.3.jar和hamcrest-library-1.3.jar
运行测试,问题解决。
阅读全文
0 0
- Spring4.3.8使用单元测试报错
- iOS framework 使用单元测试报错解决
- spring4.0 使用@Aspect 报错之缺少包
- spring4整合hibernate5报错解决
- spring4配置jackson报错解决
- Spring4 整合hibernate3报错问题
- 最近使用spring4.0的Mvc,json请求时,客户端报错,406 Not Acceptable
- junit4单元测试报错解决
- Spring4+Struts2+Hibernate5报错:Unable to load configuration. - action -
- java学习——使用Eclipse进行单元测试,报错Can't allocate jvmti memory
- junit单元测试@Test报错的解决办法
- spring接入swagger后单元测试报错
- spring接入swagger后单元测试报错
- spring+mybatis做单元测试报错IllegalStateException
- mybatis+spring spring单元测试报错
- Spring4.1+junit4.9进行单元测试
- Spring4+Junit4单元测试及bug解决
- 使用jUnit4测试Spring4
- SpringSide3 PropertyFilter介绍
- JavaWeb中的文件上传
- 文章标题
- Linux操作系统上安装JDK
- 蓝桥杯 历届试题 带分数 (暴力枚举)
- Spring4.3.8使用单元测试报错
- java 常用设计模式-策略模式(strategy)
- Spring3 注解说明
- 设计模式入门之鸭子问题
- 习题8-14 商队抢劫者(Caravan Robbers ACMICPC NEERC 2012 UVa1616)
- [leetcode: Python]404. Sum of Left Leaves
- Android开源库V
- Android编程至高武学之《如来神掌》第五式~迎佛西天
- Android 自定义View(二)函数分析