initializationError,无法解决,导入其他版本的jar包已经试过了。

SeckillServiceTest
org.seckill.service.SeckillServiceTest
initializationError(org.seckill.service.SeckillServiceTest)
java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;

    at java.lang.Class.getDeclaredFields0(Native Method)

    at java.lang.Class.privateGetDeclaredFields(Unknown Source)

    at java.lang.Class.getDeclaredFields(Unknown Source)

    at org.junit.runners.model.TestClass.<init>(TestClass.java:49)

    at org.junit.runners.ParentRunner.<init>(ParentRunner.java:75)

    at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:57)

    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:111)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

    at java.lang.reflect.Constructor.newInstance(Unknown Source)

    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)

    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)

    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)

    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)

    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)

    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)

    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Caused by: java.lang.ClassNotFoundException: org.slf4j.Logger

    at java.net.URLClassLoader.findClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    ... 24 more




叶雪松
浏览 1544回答 1
1回答

younghu

java.lang.NoClassDefFoundError: Lorg/slf4j/Logger;这行,扫了 slf4j jar包如果确定没有少,去看看class 输出位置!
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java