Announcement Announcement Module
Collapse
No announcement yet.
Very deep call stack in bean initialization Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Very deep call stack in bean initialization

    We have about 500~ spring beans, and every time the war bootstrapped, the whole container will collapse and has the call stack like:

    at org/springframework/beans/factory/support/AbstractBeanFactory.doGetBean(AbstractBeanFactory. java:292)
    at org/springframework/beans/factory/support/AbstractBeanFactory.getTypeForFactoryBean(Abstract BeanFactory.java:1362)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.getTypeForFacto ryBean(AbstractAutowireCapableBeanFactory.java:726 )
    at org/springframework/beans/factory/support/AbstractBeanFactory.isTypeMatch(AbstractBeanFactor y.java:523)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.doGetBeanNamesForType(D efaultListableBeanFactory.java:357)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.getBeanNamesForType(Def aultListableBeanFactory.java:335)
    at org/springframework/beans/factory/BeanFactoryUtils.beanNamesForTypeIncludingAncestor s(BeanFactoryUtils.java:187)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.findAutowireCandidates( DefaultListableBeanFactory.java:895)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.doResolveDependency(Def aultListableBeanFactory.java:853)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.resolveDependency(Defau ltListableBeanFactory.java:768)
    at org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor$AutowiredMeth odElement.inject(AutowiredAnnotationBeanPostProces sor.java:558)
    at org/springframework/beans/factory/annotation/InjectionMetadata.inject(InjectionMetadata.java:87 )
    at org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.postProcessPr opertyValues(AutowiredAnnotationBeanPostProcessor. java:285)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.populateBean(Ab stractAutowireCapableBeanFactory.java:1122)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.doCreateBean(Ab stractAutowireCapableBeanFactory.java:522)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.createBean(Abst ractAutowireCapableBeanFactory.java:461)
    at org/springframework/beans/factory/support/AbstractBeanFactory$1.getObject(AbstractBeanFactor y.java:295)
    at org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.getSingleton(DefaultS ingletonBeanRegistry.java:223)
    ^-- Holding lock: java/util/concurrent/ConcurrentHashMap@0x995b5bd0[recursive]
    at org/springframework/beans/factory/support/AbstractBeanFactory.doGetBean(AbstractBeanFactory. java:292)
    at org/springframework/beans/factory/support/AbstractBeanFactory.getTypeForFactoryBean(Abstract BeanFactory.java:1362)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.getTypeForFacto ryBean(AbstractAutowireCapableBeanFactory.java:726 )
    at org/springframework/beans/factory/support/AbstractBeanFactory.isTypeMatch(AbstractBeanFactor y.java:523)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.doGetBeanNamesForType(D efaultListableBeanFactory.java:357)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.getBeanNamesForType(Def aultListableBeanFactory.java:335)
    at org/springframework/beans/factory/BeanFactoryUtils.beanNamesForTypeIncludingAncestor s(BeanFactoryUtils.java:187)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.findAutowireCandidates( DefaultListableBeanFactory.java:895)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.doResolveDependency(Def aultListableBeanFactory.java:853)
    at org/springframework/beans/factory/support/DefaultListableBeanFactory.resolveDependency(Defau ltListableBeanFactory.java:768)
    at org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor$AutowiredMeth odElement.inject(AutowiredAnnotationBeanPostProces sor.java:558)
    at org/springframework/beans/factory/annotation/InjectionMetadata.inject(InjectionMetadata.java:87 )
    at org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.postProcessPr opertyValues(AutowiredAnnotationBeanPostProcessor. java:285)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.populateBean(Ab stractAutowireCapableBeanFactory.java:1122)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.doCreateBean(Ab stractAutowireCapableBeanFactory.java:522)
    at org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.createBean(Abst ractAutowireCapableBeanFactory.java:461)

    repeated about 500 times. We needs to increase jvm stack size to about 2mb to solve this problem.

    What's the cause that makes the container calls that deep in bean initialization?

    (We use mybatis and mybatis-spring integration in DAO mapper bean creation)
Working...
X