Open source software supply chain lighting plan, waiting for you>>>
Error in testing mybatis:
Error information:
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.junit.internal.builders.JUnit4Builder.runnerForClass(JUnit4Builder.java:10)
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:33)
at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 22 more
Solution:
1. Import JUnit of lower version (recommended 4.10)
2. Introduce hamcrest-core-1.3.jar
Similar Posts:
- java.lang.Exception: No runnable methods
- JUnit Error: java.lang.IncompatibleClassChangeError [How to Solve]
- [Java. Lang. unsupported classversionerror] version inconsistency error
- [How to Solve] Hive: Unsupported major.minor version 51.0
- [Solved] java.lang.Exception: No runnable methodsĀ at org.junit.runners.BlockJUnit4ClassRunner.validateIns…
- com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class tonels.
- JUnit error: Java. Lang. exception: the test class should have only one public constructor
- [Solved] Spring Boot Use Spring Data Redis Error: org.springframework.beans.factory.BeanCreationException
- [Solved] Java.lang.ClassNotFoundException: javax.xml.bind.JAXBException (i)
- [Solved] MVN – version error: Exception in thread “main” java.lang.UnsupportedClassVersionError