java.lang.ArrayStoreException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
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.

  • The Variant Plugin (https://github.com/jenkinsci/variant-plugin/) is not working properly when you specify `requiredClasses` and one of them do not exists. There are two observed situations. * If the annotated class extends the non existent class this exception is thrown: {code} WARNING: Failed to load org.jenkinsci.plugins.variant.Negative4 java.lang.InstantiationException: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/Beer at net.java.sezpoz.IndexItem.element(IndexItem.java:146) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.configure(ExtensionFinder.java:504) at com.google.inject.AbstractModule.configure(AbstractModule.java:62) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230) at com.google.inject.spi.Elements.getElements(Elements.java:103) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at hudson.ExtensionFinder$GuiceFinder.<init>(ExtensionFinder.java:282) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at net.java.sezpoz.IndexItem.instance(IndexItem.java:181) at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:642) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617) at hudson.ExtensionFinder._find(ExtensionFinder.java:151) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:345) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.iterator(ExtensionList.java:143) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:338) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.get(ExtensionList.java:158) at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1248) at hudson.maven.PluginImpl.init(PluginImpl.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$7.runTask(Jenkins.java:886) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/Beer at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:412) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at net.java.sezpoz.IndexItem.element(IndexItem.java:134) ... 41 more Caused by: java.lang.ClassNotFoundException: org.jenkinsci.plugins.Beer at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 55 more {code} This is due to the fact that Guice is not treating it as optional. * If the class is not extended and just used inside the annotated class: {code} INFO: An exception was caught and reported. Message: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:715) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:522) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:348) at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:283) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3271) at java.lang.Class.getDeclaredAnnotations(Class.java:3248) at org.jenkinsci.plugins.variant.OptionalExtensionProcessor.isActive(OptionalExtensionProcessor.java:46) at hudson.ExtensionFinder$GuiceFinder.isActive(ExtensionFinder.java:375) at hudson.ExtensionFinder$GuiceFinder.access$400(ExtensionFinder.java:234) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.configure(ExtensionFinder.java:506) at com.google.inject.AbstractModule.configure(AbstractModule.java:62) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230) at com.google.inject.spi.Elements.getElements(Elements.java:103) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at hudson.ExtensionFinder$GuiceFinder.<init>(ExtensionFinder.java:282) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at net.java.sezpoz.IndexItem.instance(IndexItem.java:181) at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:642) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617) at hudson.ExtensionFinder._find(ExtensionFinder.java:151) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:345) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.iterator(ExtensionList.java:143) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:338) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.get(ExtensionList.java:158) at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1248) at hudson.maven.PluginImpl.init(PluginImpl.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$7.runTask(Jenkins.java:886) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code} This is related to this bug in the JDK http://bugs.java.com/view_bug.do?bug_id=7183985 by which an annotation with a non existent class in a value cannot be loaded.
    via by Alvaro Lobato,
  • 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,
  • Re: stack trace with non-existent line number
    via by Daniel Kulp,
    • java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:715) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:522) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:348) at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:283) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:117) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3271) at java.lang.Class.getDeclaredAnnotations(Class.java:3248) at org.jenkinsci.plugins.variant.OptionalExtensionProcessor.isActive(OptionalExtensionProcessor.java:46) at hudson.ExtensionFinder$GuiceFinder.isActive(ExtensionFinder.java:375) at hudson.ExtensionFinder$GuiceFinder.access$400(ExtensionFinder.java:234) at hudson.ExtensionFinder$GuiceFinder$SezpozModule.configure(ExtensionFinder.java:506) at com.google.inject.AbstractModule.configure(AbstractModule.java:62) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230) at com.google.inject.spi.Elements.getElements(Elements.java:103) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at hudson.ExtensionFinder$GuiceFinder.<init>(ExtensionFinder.java:282) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at net.java.sezpoz.IndexItem.instance(IndexItem.java:181) at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:642) at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617) at hudson.ExtensionFinder._find(ExtensionFinder.java:151) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:345) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.iterator(ExtensionList.java:143) at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:338) at hudson.ExtensionList.load(ExtensionList.java:300) at hudson.ExtensionList.ensureLoaded(ExtensionList.java:253) at hudson.ExtensionList.get(ExtensionList.java:158) at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1248) at hudson.maven.PluginImpl.init(PluginImpl.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:105) at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:169) at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) at jenkins.model.Jenkins$7.runTask(Jenkins.java:886) at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

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