Home  >  Forum  >  Spring
Post New Query

Error: NoSuchBeanDefinitionException



Asked on April 03, 2013
Hi I am getting below error.

Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'beanname' is defined
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)


need help




Replied on April 03, 2013
explain exactly what are you doing


Replied on April 03, 2013
I am using
<context:component-scan base-package="some package" />
And I have put my class in the defined package.



Replied on April 03, 2013
You need to check if your class is annotated with @Component . 


Replied on April 03, 2013
ya resolved. I forgot to annotate with @Componenet


Write Answer








©2019 concretepage.com | Privacy Policy | Contact Us