Skip to content

Improve diagnostics when AnnotationAttributesReadingVisitor triggers an ArrayStoreException from Class.getAnnotations() [SPR-12387] #16995

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-12387 and commented

Here's an example of the failure:

code
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241)
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:3178)
at java.lang.Class.getAnnotations(Class.java:3158)
at org.springframework.core.type.classreading.AnnotationAttributesReadingVisitor.doVisitEnd(AnnotationAttributesReadingVisitor.java:269)
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:182)
code

As with similar issues, it'd be great to know which class was being introspected when the failure occurred


Affects: 4.0.7, 4.1.1

Issue Links:

Referenced from: commits 91940f2, b70c5d1

Backported to: 4.0.8

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions