title: @Autowired not managed in spring mvc "Injection of autowired dependencies failed"
body: <p>im trying to inject a bean into my class java ValiderBR</p>
  
  <pre><code> @Service
   public class ValiderBR extends BusinessRule {
    @Autowired
      ILog logger;
  ...
  }
  </code></pre>
  
  <p>but i have an error of injection caused by the @Autowired annotation</p>
  
  <pre><code>22 mai 2013 14:44:02 org.apache.catalina.core.ApplicationContext log
  GRAVE: StandardWrapper.Throwable
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'validerBR': Injection   of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: ma.co.services.log.ILog awb.businessrules.WorkflowIndividu.ValiderBR.logger; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [ma.co.services.log.ILog] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:288)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
  at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)
  at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518)
  at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459)
  at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
  at javax.servlet.GenericServlet.init(GenericServlet.java:160)
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
  at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field:    ma.co.services.log.ILog awb.businessrules.WorkflowIndividu.ValiderBR.logger; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [ma.co.services.log.ILog] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  at  org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:514)
  at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
  at  org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
  ... 30 more
  Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type  [ma.co.services.log.ILog] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:986)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:856)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
  ... 32 more
  22 mai 2013 14:44:02 org.apache.catalina.core.StandardContext loadOnStartup
  GRAVE: La servlet /appExempleSpring-web a généré une exception "load()"
  org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type  [ma.co.services.log.ILog] found for dependency: expected at least 1 bean which qualifies as  autowire candidate for this dependency. Dependency annotations:  {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  at  org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:986)
  at  org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:856)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:768)
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:486)
  at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
  at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1122)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
  at  org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
  at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599)
  at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)
  at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518)
  at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459)
  at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
  at javax.servlet.GenericServlet.init(GenericServlet.java:160)
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1267)
  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1186)
  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1081)
  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
  at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  22 mai 2013 14:44:02 org.apache.catalina.startup.HostConfig deployDirectory
  </code></pre>
  
  <p>and there is my configuration in spring-servlet.xml</p>
  
  <pre><code>    &lt;context:annotation-config /&gt;
      &lt;context:component-scan base-package="client.controller" /&gt;  
  
      &lt;context:component-scan base-package="ma" /&gt;  
      &lt;context:component-scan base-package="awb" /&gt;  
  
     &lt;bean id="jspViewResolver"
         class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
         &lt;property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView" /&gt;
         &lt;property name="prefix" value="/WEB-INF/jsp/" /&gt;
         &lt;property name="suffix" value=".jsp" /&gt;
     &lt;/bean&gt;
  </code></pre>
  
  <p>and there is my ILog interface</p>
  
  <pre><code>public interface ILog {
  
  
  void debug(String msg);
  
  void debug(String msg, Throwable t);
  
  void error(String msg);
  
  void error(String msg, Throwable t);
  
  void fatal(String msg);
  
  void fatal(String msg, Throwable t);
  
  void info(String msg);
  
  void info(String msg, Throwable t);
  
  void warning(String msg);
  
  void warning(String msg, Throwable t);
  </code></pre>
  
  <p>}</p>
  
  <p>and there the class that implement the ILog interface</p>
  
  <pre><code>public class Slf4jLogger implements ILog {
  private Logger logger = LoggerFactory.getLogger(Slf4jLogger.class);
  
  public void debug(String msg) {
      logger.debug(msg);
  }
  
  public void debug(String msg, Throwable t) {
      logger.debug(msg, t);
  }
  
  public void error(String msg) {
      logger.error(msg);
  }
  
  public void error(String msg, Throwable t) {
      logger.error(msg, t);
  }
  
  public void fatal(String msg) {
      logger.error("FATAL ERROR:" + msg);
  }
  
  public void fatal(String msg, Throwable t) {
      logger.error("FATAL ERROR:" + msg, t);
  }
  
  public void info(String msg) {
      logger.info(msg);
  }
  
  public void info(String msg, Throwable t) {
      logger.info(msg, t);
  }
  
  public void warning(String msg) {
      logger.warn(msg);
  }
  
  public void warning(String msg, Throwable t) {
      logger.warn(msg, t);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Thank's in advance for help.</p>