org.springframework.beans.factory.NoSuchBeanDefinitionException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • A custom-scoped bean cannot be declared as such in Spring 2.0.2: <bean ....> <property name="jobCounter"> <bean class="com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter" scope="report"> <aop:scoped-proxy /> </bean> </property> </bean> It must be declared outside the parent and referenced: <bean id="jobCounter" class="com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter" scope="report"> <aop:scoped-proxy /> </bean> <bean ....> <property name="jobCounter" ref="jobCounter" /> </bean> (note: the fact that the bean is a static inner class has nothing to do with this, I get the same problem with a regular non-inner class) The first definition style works fine in version 2.0.0 (final) but fails in 2.0.2 with this error message: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'scopedTarget.com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter#14db0e3' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906) at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:351) at org.springframework.aop.target.AbstractPrototypeBasedTargetSource.setBeanFactory(AbstractPrototypeBasedTargetSource.java:44) at org.springframework.aop.scope.ScopedProxyFactoryBean.setBeanFactory(ScopedProxyFactoryBean.java:84) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1076) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:270) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    via by Bruno Navert,
  • A custom-scoped bean cannot be declared as such in Spring 2.0.2: <bean ....> <property name="jobCounter"> <bean class="com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter" scope="report"> <aop:scoped-proxy /> </bean> </property> </bean> It must be declared outside the parent and referenced: <bean id="jobCounter" class="com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter" scope="report"> <aop:scoped-proxy /> </bean> <bean ....> <property name="jobCounter" ref="jobCounter" /> </bean> (note: the fact that the bean is a static inner class has nothing to do with this, I get the same problem with a regular non-inner class) The first definition style works fine in version 2.0.0 (final) but fails in 2.0.2 with this error message: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'scopedTarget.com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter#14db0e3' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906) at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:351) at org.springframework.aop.target.AbstractPrototypeBasedTargetSource.setBeanFactory(AbstractPrototypeBasedTargetSource.java:44) at org.springframework.aop.scope.ScopedProxyFactoryBean.setBeanFactory(ScopedProxyFactoryBean.java:84) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1076) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:270) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
    via by Bruno Navert,
  • Mule User mailing list
    via by Unknown author,
    • org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'scopedTarget.com.ms.wi.ireports.ce.async.SubmitJobExecutor$JobCounter#14db0e3' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906) at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:351) at org.springframework.aop.target.AbstractPrototypeBasedTargetSource.setBeanFactory(AbstractPrototypeBasedTargetSource.java:44) at org.springframework.aop.scope.ScopedProxyFactoryBean.setBeanFactory(ScopedProxyFactoryBean.java:84) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1076) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:429) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:250) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:247) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:270) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)

    Users with the same issue

    Victor_ITVictor_IT
    1 times, last one,
    tvrmsmithtvrmsmith
    2 times, last one,
    bernardpaulusbernardpaulus
    27 times, last one,
    oddodd
    42 times, last one,
    ivanszkypeterivanszkypeter
    3 times, last one,
    93 more bugmates