Announcement Announcement Module
Collapse
No announcement yet.
Why I get a NoSuchBeanDefinitionException? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why I get a NoSuchBeanDefinitionException?

    In a Spring configuration file, I have
    Code:
       <bean id="myBean" class="..." />
    And in a Java class, I have
    Code:
    @Resource(name="myBean")
    private MyClass myBean;
    I get an exception
    org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'myBean' is defined.
    I use @autowired and get the same exception with a message "No qualifying bean of type ... found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency ..."

    There are two signs in the shape of "(" and ")" above and below the bean definition with a message "advised by org.springframework.transcation.interceptor.invole (org.aopalliance.intercept.MethodInvocation)" and a message "7
    Spring AOP market at this line" on the left side of the configuration file. Are they the causes? If so, how to solve it?

    Spring version 3.1
Working...
X