java.lang.NoClassDefFoundError: org/springframework/test/context/ContextHierarchy

codegur.website | 9 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd , Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0

    Cucumber-JVM - Java 8 - Step definitions not found

    Stack Overflow | 1 year ago | Fla
    java.lang.NoClassDefFoundError: org/springframework/test/context/ContextHierarchy
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0
    samebug tip
    A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.
  4. 0
    samebug tip
    If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add with the following: <groupId>com.fasterxml</groupId> <artifactId>classmate</artifactId> <version>1.0</version>
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.springframework.test.context.ContextHierarchy

    at java.net.URLClassLoader.findClass()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    2. java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    3. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    4 frames
  3. cucumber.runtime.java
    SpringFactory.addClass
    1. cucumber.runtime.java.spring.SpringFactory.annotatedWithSupportedSpringRootTestAnnotations(SpringFactory.java:198)
    2. cucumber.runtime.java.spring.SpringFactory.dependsOnSpringContext(SpringFactory.java:187)
    3. cucumber.runtime.java.spring.SpringFactory.addClass(SpringFactory.java:61)
    3 frames
  4. Cucumber-JVM: Java
    JavaBackend.loadGlue
    1. cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:96)
    1 frame
  5. Cucumber-JVM: Core
    Runtime.<init>
    1. cucumber.runtime.Runtime.<init>(Runtime.java:91)
    2. cucumber.runtime.Runtime.<init>(Runtime.java:69)
    3. cucumber.runtime.Runtime.<init>(Runtime.java:65)
    3 frames
  6. Cucumber-JVM: JUnit
    Cucumber.<init>
    1. cucumber.api.junit.Cucumber.createRuntime(Cucumber.java:78)
    2. cucumber.api.junit.Cucumber.<init>(Cucumber.java:58)
    2 frames
  7. Java RT
    Constructor.newInstance
    1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    4. java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    4 frames
  8. JUnit
    ClassRequest.getRunner
    1. org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
    2. org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
    3. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    4. org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    5. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    6. org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
    6 frames
  9. JUnit4 Runner
    JUnit4TestLoader.loadTests
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:84)
    2. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:70)
    3. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:43)
    3 frames
  10. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    4 frames