java.lang.TypeNotPresentException: Type [unknown] not present

Spring JIRA | leehom | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    In my test project I use the Spring TestContext Framework and JUnit 4. When I refer to my jars as an Eclipse _user library_, the following exception is thrown when I launch a test configured with {{@RunWith(SpringJUnit4ClassRunner.class)}}. {noformat} java.lang.TypeNotPresentException: Type [unknown] not present at sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27) at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56) at $Proxy4.value(Unknown Source) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24) at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:33) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:32) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestMethodReference.<init>(JUnit4TestMethodReference.java:25) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.NoClassDefFoundError: org/junit/runners/BlockJUnit4ClassRunner at java.lang.ClassLoader.findBootstrapClass(Native Method) at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:892) at java.lang.ClassLoader.loadClass(ClassLoader.java:302) at java.lang.ClassLoader.loadClass(ClassLoader.java:300) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31) at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370) at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072) at java.lang.Class.getAnnotation(Class.java:3029) at org.junit.internal.builders.IgnoredBuilder.runnerForClass(IgnoredBuilder.java:13) ... 13 more {noformat}

    Spring JIRA | 5 years ago | leehom
    java.lang.TypeNotPresentException: Type [unknown] not present
  2. 0

    In my test project I use the Spring TestContext Framework and JUnit 4. When I refer to my jars as an Eclipse _user library_, the following exception is thrown when I launch a test configured with {{@RunWith(SpringJUnit4ClassRunner.class)}}. {noformat} java.lang.TypeNotPresentException: Type [unknown] not present at sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27) at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:56) at $Proxy4.value(Unknown Source) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24) at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:33) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:32) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestMethodReference.<init>(JUnit4TestMethodReference.java:25) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.NoClassDefFoundError: org/junit/runners/BlockJUnit4ClassRunner at java.lang.ClassLoader.findBootstrapClass(Native Method) at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:892) at java.lang.ClassLoader.loadClass(ClassLoader.java:302) at java.lang.ClassLoader.loadClass(ClassLoader.java:300) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31) at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370) at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3072) at java.lang.Class.getAnnotation(Class.java:3029) at org.junit.internal.builders.IgnoredBuilder.runnerForClass(IgnoredBuilder.java:13) ... 13 more {noformat}

    Spring JIRA | 5 years ago | leehom
    java.lang.TypeNotPresentException: Type [unknown] not present
  3. 0

    NoClassDefFoundError with Spring 3 and junit 4.8.1 - Spring Forum

    spring.io | 11 months ago
    java.lang.TypeNotPresentException: Type [unknown] not present
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    TypeNotPresentException with JUnitParamsRunner

    Stack Overflow | 3 days ago | user3599233
    java.lang.TypeNotPresentException: Type [unknown] not present
  6. 0

    Applet error - java.lang.NoClassDefFoundError: sun/misc/ProxyGenerator

    Stack Overflow | 3 years ago | de.coding.myth
    java.lang.NoClassDefFoundError: sun/misc/ProxyGenerator

    1 unregistered visitors
    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.NoClassDefFoundError

      org/junit/runners/BlockJUnit4ClassRunner

      at java.lang.ClassLoader.findBootstrapClass()
    2. Java RT
      Class.getAnnotation
      1. java.lang.ClassLoader.findBootstrapClass(Native Method)
      2. java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:892)
      3. java.lang.ClassLoader.loadClass(ClassLoader.java:302)
      4. java.lang.ClassLoader.loadClass(ClassLoader.java:300)
      5. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      6. java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      7. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      8. java.lang.Class.forName0(Native Method)
      9. java.lang.Class.forName(Class.java:247)
      10. sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
      11. sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
      12. sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
      13. sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:370)
      14. sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:351)
      15. sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:280)
      16. sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
      17. sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
      18. sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
      19. java.lang.Class.initAnnotationsIfNecessary(Class.java:3072)
      20. java.lang.Class.getAnnotation(Class.java:3029)
      20 frames
    3. JUnit
      FilterRequest.getRunner
      1. org.junit.internal.builders.IgnoredBuilder.runnerForClass(IgnoredBuilder.java:13)
      2. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      3. org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
      4. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      5. org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
      6. org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:33)
      6 frames
    4. JUnit4 Runner
      JUnit4TestLoader.loadTests
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:32)
      2. org.eclipse.jdt.internal.junit4.runner.JUnit4TestMethodReference.<init>(JUnit4TestMethodReference.java:25)
      3. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:42)
      4. org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:31)
      4 frames
    5. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      4 frames