Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spring-projects-issues opened this issue Oct 28, 2014 · 0 comments
Assignees
Labels
in: core status: backported type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Oct 28, 2014

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:

  • #15074 java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy exception when annotation config not found needs to specify what class is not found
  • #16930 AnnotationUtils provides poor diagnostics if getDeclaredAnnotations throws an exception
  • #17112 Useless exception message when annotations can't be parsed
  • #17173 Improve diagnostics when AnnotationJmxAttributeSource triggers an ArrayStoreException from Class.getAnnotation

Referenced from: commits 91940f2, b70c5d1

Backported to: 4.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants