Skip to content

MongoAutoConfiguration causes TypeNotPresentExceptionProxy error since 1.2.0 #2196

@sjoerdmulder

Description

@sjoerdmulder

The MongoAutoConfiguration class has a @ConditionalOnMissingBean(MongoDbFactory.class) annotation, but the org.springframework.data.mongodb.MongoDbFactory from Spring Data is not included in our project because we don't use Spring Data. Found this by having a breakpoint on the AnnotationJmxAttributeSource.java:73 file until it failed...

Before version 1.2.0 we didn't have any issues.

Java version:

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17

Trying to start the project gives the following stacktrace:

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)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions