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.

  • GitHub comment 4321#151782768
    via GitHub by wilkinsona
    ,
  • Java: ArrayStoreException Spring boot app
    via Stack Overflow by Riyaz Shaikh
    ,
  • 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" `type="java.lang.ArrayStoreException">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:3521) at java.lang.Class.annotationData(Class.java:3510) at java.lang.Class.getAnnotations(Class.java:3446) at org.junit.runner.Description.createSuiteDescription(Description.java:124) at org.junit.internal.runners.ErrorReportingRunner.getDescription(ErrorReportingRunner.java:28) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.allTestsFiltered(JUnitTestClassExecuter.java:117) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:106) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:56) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

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