java.lang.ArrayIndexOutOfBoundsException: 10

Spring JIRA | Tom Ziemer | 6 years ago
  1. 0

    Sometimes, mostly after app-server restarts or simple ear-redeployments we encounter a bean creation issue: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fooBar' defined in class path resource [spring/foo-context.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 10 The project consists of around 500 beans, 20% prototypes. Only some singletons are advised, using <aop:config> - Prototypes are injecting using org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean. If the issue occurs it always affects the first request and only the first request - all following requests pass. We were unable to reproduce the issue on a small-scale project. Nevertheless, we were able to trace the issue down to AspectJ and filed a bug: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg12764.html https://bugs.eclipse.org/bugs/show_bug.cgi?id=337855 As a workaround, we replaced AspectJ with SpringAOP, which appears to be working well. While this certainly seems to be an AspectJ issue, the stacktrace below shows, that AbstractAdvisorAutoProxyCreator is also involved. This is rather surprising for me, since, as I said, only a few singletons are advised, yet it looks like AbstractAdvisorAutoProxyCreator is called during the ObjectFactoryCreatingFactoryBean.getObject() method which creates my AOP-free prototypes. Is this really intended and necessary? Full stacktrace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fooBar' defined in class path resource [spring/foo-context.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject(ObjectFactoryCreatingFactoryBean.java:146) at foo.bar.baz.a.b.c.foo(C.java:99) at foo.bar.baz.service.X.Y(Z.java:161) at foo.bar.baz.servlet.K.bar(M.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3587) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) java.lang.ArrayIndexOutOfBoundsException: 10 at java.util.ArrayList.add(ArrayList.java:352) at org.aspectj.weaver.ReferenceType.addDependentType(ReferenceType.java:115) at org.aspectj.weaver.ReferenceType.<init>(ReferenceType.java:95) at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:43) at org.aspectj.weaver.reflect.JavaLangTypeToResolvedTypeConverter.fromType(JavaLangTypeToResolvedTypeConverter.java:88) at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getSuperclass(Java15ReflectionBasedReferenceTypeDelegate.java:148) at org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:906) at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:144) at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:82) at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:238) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254) at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject(ObjectFactoryCreatingFactoryBean.java:146) at foo.bar.baz.a.b.c.foo(C.java:99) at foo.bar.baz.service.X.Y(Z.java:161) at foo.bar.baz.servlet.K.bar(M.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3587) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    Spring JIRA | 6 years ago | Tom Ziemer
    java.lang.ArrayIndexOutOfBoundsException: 10
  2. 0

    Sometimes, mostly after app-server restarts or simple ear-redeployments we encounter a bean creation issue: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fooBar' defined in class path resource [spring/foo-context.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 10 The project consists of around 500 beans, 20% prototypes. Only some singletons are advised, using <aop:config> - Prototypes are injecting using org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean. If the issue occurs it always affects the first request and only the first request - all following requests pass. We were unable to reproduce the issue on a small-scale project. Nevertheless, we were able to trace the issue down to AspectJ and filed a bug: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg12764.html https://bugs.eclipse.org/bugs/show_bug.cgi?id=337855 As a workaround, we replaced AspectJ with SpringAOP, which appears to be working well. While this certainly seems to be an AspectJ issue, the stacktrace below shows, that AbstractAdvisorAutoProxyCreator is also involved. This is rather surprising for me, since, as I said, only a few singletons are advised, yet it looks like AbstractAdvisorAutoProxyCreator is called during the ObjectFactoryCreatingFactoryBean.getObject() method which creates my AOP-free prototypes. Is this really intended and necessary? Full stacktrace: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fooBar' defined in class path resource [spring/foo-context.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 10 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject(ObjectFactoryCreatingFactoryBean.java:146) at foo.bar.baz.a.b.c.foo(C.java:99) at foo.bar.baz.service.X.Y(Z.java:161) at foo.bar.baz.servlet.K.bar(M.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3587) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) java.lang.ArrayIndexOutOfBoundsException: 10 at java.util.ArrayList.add(ArrayList.java:352) at org.aspectj.weaver.ReferenceType.addDependentType(ReferenceType.java:115) at org.aspectj.weaver.ReferenceType.<init>(ReferenceType.java:95) at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:43) at org.aspectj.weaver.reflect.JavaLangTypeToResolvedTypeConverter.fromType(JavaLangTypeToResolvedTypeConverter.java:88) at org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getSuperclass(Java15ReflectionBasedReferenceTypeDelegate.java:148) at org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:906) at org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:144) at org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:82) at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:238) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200) at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254) at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87) at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359) at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject(ObjectFactoryCreatingFactoryBean.java:146) at foo.bar.baz.a.b.c.foo(C.java:99) at foo.bar.baz.service.X.Y(Z.java:161) at foo.bar.baz.servlet.K.bar(M.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3587) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    Spring JIRA | 6 years ago | Tom Ziemer
    java.lang.ArrayIndexOutOfBoundsException: 10
  3. 0

    ArrayIndexOutOfBoundsException

    GitHub | 2 years ago | VISTALL
    java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 10
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    dropdowns problem

    Google Groups | 9 years ago | iridis
    java.lang.ArrayIndexOutOfBoundsException: 10
  6. 0

    dropdowns problem

    Google Groups | 9 years ago | iridis
    java.lang.ArrayIndexOutOfBoundsException: 10

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ArrayIndexOutOfBoundsException

      10

      at java.util.ArrayList.add()
    2. Java RT
      ArrayList.add
      1. java.util.ArrayList.add(ArrayList.java:352)
      1 frame
    3. AspectJ weaver
      PointcutExpressionImpl.couldMatchJoinPointsInType
      1. org.aspectj.weaver.ReferenceType.addDependentType(ReferenceType.java:115)
      2. org.aspectj.weaver.ReferenceType.<init>(ReferenceType.java:95)
      3. org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:43)
      4. org.aspectj.weaver.reflect.JavaLangTypeToResolvedTypeConverter.fromType(JavaLangTypeToResolvedTypeConverter.java:88)
      5. org.aspectj.weaver.reflect.Java15ReflectionBasedReferenceTypeDelegate.getSuperclass(Java15ReflectionBasedReferenceTypeDelegate.java:148)
      6. org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:906)
      7. org.aspectj.weaver.patterns.KindedPointcut.fastMatch(KindedPointcut.java:144)
      8. org.aspectj.weaver.internal.tools.PointcutExpressionImpl.couldMatchJoinPointsInType(PointcutExpressionImpl.java:82)
      8 frames
    4. Spring AOP
      AbstractAutoProxyCreator.postProcessAfterInitialization
      1. org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:238)
      2. org.springframework.aop.support.AopUtils.canApply(AopUtils.java:200)
      3. org.springframework.aop.support.AopUtils.canApply(AopUtils.java:254)
      4. org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:286)
      5. org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
      6. org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
      7. org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
      8. org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
      9. org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
      9 frames
    5. Spring Beans
      ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      7. org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean$TargetBeanObjectFactory.getObject(ObjectFactoryCreatingFactoryBean.java:146)
      7 frames
    6. foo.bar.baz
      K.bar
      1. foo.bar.baz.a.b.c.foo(C.java:99)
      2. foo.bar.baz.service.X.Y(Z.java:161)
      3. foo.bar.baz.servlet.K.bar(M.java:136)
      3 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      2 frames
    8. Atmosphere weblogic
      WebAppServletContext$ServletInvocationAction.run
      1. weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      2. weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      3. weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
      4. weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
      5. weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3587)
      5 frames
    9. weblogic.security.acl
      AuthenticatedSubject.doAs
      1. weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      1 frame