java.lang.ArrayStoreException

tip

This might be a conflict between different annotation methods. Try not using more than one to avoid conflicts.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • SYNOPSIS -------- Class.getAnnotation() throws an ArrayStoreException when the annotation class is not present in the classpath OPERATING SYSTEM ---------------- All (tested on Windows and Solaris) FULL JDK VERSION ---------------- JDK 5 and greater, including JDK 8 Note: The ArrayStoreException begin with 5.0u6 (See CR 6322301 fix). PROBLEM DESCRIPTION from LICENSEE --------------------------------- A call to Class.getAnnotation() throws the following java.lang.ArrayStoreException when an annotation's Class is not present on the classpath. The following stack is from JDK8-b39: Exception in thread "main" java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3093) at java.lang.Class.getAnnotation(Class.java:3052) at AnnotationTest.doTest(AnnotationTest.java:9) at AnnotationTest.main(AnnotationTest.java:5) The API specification for java.lang.Class states that Class.getAnnotation() returns this element's annotation for the specified type if such an annotation is present, else null. ArrayStoreException is not a checked Exception so it doesn't have to be declared, but it effectively prevents the API from following the specification - either the annotation should be returned, or null. Currently neither happens. The application could catch the ArrayStoreException and handle it, but Licensee prefers it to be dealt with in the JDK's internal implementation. TESTCASE AND REPRODUCTION INSTRUCTIONS -------------------------------------- Attached WORKAROUND ---------- Catch the undocumented ArrayStoreException and handle it.
    via by David Korbel,
  • SYNOPSIS -------- Class.getAnnotation() throws an ArrayStoreException when the annotation class is not present in the classpath OPERATING SYSTEM ---------------- All (tested on Windows and Solaris) FULL JDK VERSION ---------------- JDK 5 and greater, including JDK 8 Note: The ArrayStoreException begin with 5.0u6 (See CR 6322301 fix). PROBLEM DESCRIPTION from LICENSEE --------------------------------- A call to Class.getAnnotation() throws the following java.lang.ArrayStoreException when an annotation's Class is not present on the classpath. The following stack is from JDK8-b39: Exception in thread "main" java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3093) at java.lang.Class.getAnnotation(Class.java:3052) at AnnotationTest.doTest(AnnotationTest.java:9) at AnnotationTest.main(AnnotationTest.java:5) The API specification for java.lang.Class states that Class.getAnnotation() returns this element's annotation for the specified type if such an annotation is present, else null. ArrayStoreException is not a checked Exception so it doesn't have to be declared, but it effectively prevents the API from following the specification - either the annotation should be returned, or null. Currently neither happens. The application could catch the ArrayStoreException and handle it, but Licensee prefers it to be dealt with in the JDK's internal implementation. TESTCASE AND REPRODUCTION INSTRUCTIONS -------------------------------------- Attached WORKAROUND ---------- Catch the undocumented ArrayStoreException and handle it.
    via by David Korbel,
  • JBoss migrating error
    via Stack Overflow by graczun
    ,
    • java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3093) at java.lang.Class.getAnnotation(Class.java:3052) at AnnotationTest.doTest(AnnotationTest.java:9) at AnnotationTest.main(AnnotationTest.java:5)

    Users with the same issue

    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor2 times, last one,
    tvrmsmithtvrmsmith
    20 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    26 more bugmates