Skip to content

Improve diagnostics when AnnotationJmxAttributeSource triggers an ArrayStoreException from Class.getAnnotation [SPR-12572] #17173

@spring-projects-issues

Description

@spring-projects-issues

Andy Wilkinson opened SPR-12572 and commented

As with other issues like this, it'd be useful to know the name of the class that's being introspected when the failure occurs. Here's an example stacktrace for the failure:

Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
    at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
    at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
    at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
    at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
    at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
    at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
    at java.lang.Class.createAnnotationData(Class.java:3513)
    at java.lang.Class.annotationData(Class.java:3502)
    at java.lang.Class.getAnnotation(Class.java:3407)
    at org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource.getManagedResource(AnnotationJmxAttributeSource.java:73)
    at org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler.includeBean(MetadataMBeanInfoAssembler.java:121)
    at org.springframework.jmx.export.MBeanExporter$1.include(MBeanExporter.java:856)
    at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:891)
    at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:853)
    at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:532)
    at org.springframework.jmx.export.MBeanExporter.afterSingletonsInstantiated(MBeanExporter.java:420)

Affects: 4.0.8, 4.1.3

Reference URL: spring-projects/spring-boot#2196

Issue Links:

Backported to: 4.0.9

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