Home  >  Forum  >  Spring
Post New Query

Error: NoSuchBeanDefinitionException


joined on
March 16,2013
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

joined on
March 18,2013
Replied on April 03,2013

explain exactly what are you doing
joined on
March 16,2013
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.
joined on
March 18,2013
Replied on April 03,2013

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

ya resolved. I forgot to annotate with @Componenet

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us