Closed
Description
Aaron Digulla opened SPR-12507 and commented
When a class is missing while parsing annotations in StandardAnnotationMetadata.isAnnotated
, you get this exception:
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
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:3079)
at java.lang.Class.getAnnotations(Class.java:3059)
at org.springframework.core.type.StandardAnnotationMetadata.isAnnotated(StandardAnnotationMetadata.java:123)
The error means that Java couldn't find a class inside of annotation which has a Class
value.
Can you please wrap all exceptions thrown by Class.getAnnotations()
with the name of the class which you tried to parse? That would help to narrow down the problem.
Affects: 3.2.10
Issue Links:
- java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy exception when annotation config not found needs to specify what class is not found [SPR-10441] #15074 java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy exception when annotation config not found needs to specify what class is not found ("duplicates")
- AnnotationUtils.findAnnotation fails with poor diagnostics if it encounters an Annotation that references an unloadable class [SPR-11874] #16493 AnnotationUtils.findAnnotation fails with poor diagnostics if it encounters an Annotation that references an unloadable class
- Improve diagnostics when AnnotationAttributesReadingVisitor triggers an ArrayStoreException from Class.getAnnotations() [SPR-12387] #16995 Improve diagnostics when AnnotationAttributesReadingVisitor triggers an ArrayStoreException from Class.getAnnotations()