java.lang.ArrayStoreException

tip

This might be a conflict between different annotation methods. Try not using more than one to avoid conflicts.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • It happened for me when I used Spring Configuration annotation like this: {code} @Configuration @Import({ Config.class }) public class WebConfig extends WebMvcConfigurerAdapter { ... } {code} When I renamed Config.class to CoreConfig.class the error occurred when starting jetty. this happened because the CoreConfig.class was in a different sub module of my maven project, so jetty couldn't see it (as it resolves dependencies through mvn local repository). After calling 'mvn install' everything was fine again. This is a packaging problem on user's part. Some class is not on the classpath. as described in http://stackoverflow.com/questions/11823288/java-lang-arraystoreexception-sun-reflect-annotation-typenotpresentexceptionpro However the exception stacktrace does not mention what class cannot be found by Spring. So locating the culprit in a large project is very difficult and time consuming. Spring should pinpoint the affected class, who loads that class, so app developer can fix it. {noformat} Exception in thread "main" 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.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:159) at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:152) at org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated(AnnotatedElementUtils.java:72) at org.springframework.core.type.StandardAnnotationMetadata.isAnnotated(StandardAnnotationMetadata.java:102) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:72) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:62) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:140) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:127) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:122) at org.springframework.context.annotation.AnnotationConfigApplicationContext.register(AnnotationConfigApplicationContext.java:151) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:83) at org.springframework.issues.SampleApp.main(SampleApp.java:12) {noformat}
    via by Hendy Irawan,
  • It happened for me when I used Spring Configuration annotation like this: {code} @Configuration @Import({ Config.class }) public class WebConfig extends WebMvcConfigurerAdapter { ... } {code} When I renamed Config.class to CoreConfig.class the error occurred when starting jetty. this happened because the CoreConfig.class was in a different sub module of my maven project, so jetty couldn't see it (as it resolves dependencies through mvn local repository). After calling 'mvn install' everything was fine again. This is a packaging problem on user's part. Some class is not on the classpath. as described in http://stackoverflow.com/questions/11823288/java-lang-arraystoreexception-sun-reflect-annotation-typenotpresentexceptionpro However the exception stacktrace does not mention what class cannot be found by Spring. So locating the culprit in a large project is very difficult and time consuming. Spring should pinpoint the affected class, who loads that class, so app developer can fix it. {noformat} Exception in thread "main" 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.annotation.AnnotatedElementUtils.doProcess(AnnotatedElementUtils.java:159) at org.springframework.core.annotation.AnnotatedElementUtils.process(AnnotatedElementUtils.java:152) at org.springframework.core.annotation.AnnotatedElementUtils.isAnnotated(AnnotatedElementUtils.java:72) at org.springframework.core.type.StandardAnnotationMetadata.isAnnotated(StandardAnnotationMetadata.java:102) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:72) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:62) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:140) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:127) at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:122) at org.springframework.context.annotation.AnnotationConfigApplicationContext.register(AnnotationConfigApplicationContext.java:151) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:83) at org.springframework.issues.SampleApp.main(SampleApp.java:12) {noformat}
    via by Hendy Irawan,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,
    batwalrus76
    2 times, last one,
    kjhdofjosvs
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    26 more bugmates