Spring框架整合测试时出现错误

来源:互联网 发布:疯狂淘宝李涛微博 编辑:程序博客网 时间:2024/06/06 13:15
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.(SpringJUnit4ClassRunner.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.
at
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at
at
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.
at
... 18 more


解决方法:缺少commons-logging.jar包
原创粉丝点击