title: Spring3 to Spring4 migration, No qualifying bean of type DtoMapper found for dependency
body: <p>I am migrating a working project from Spring3 to Spring4, I only changed the <code>pom.xml</code> and now (on deploy) the application cannot find any beans of my mappers at runtime. Weird thing is, all my integration and unit tests still work. (and I test my mappers there)</p>
  
  <p>I have checked multiple possible combinations of <code>@Component("languagesDtoMapper")</code> and <code>@Qualifier("languagesDtoMapper")</code>. 
  I have tried to declare the bean in my spring configuration</p>
  
  <pre><code>&lt;bean id="languagesDtoMapper" class="com.project.mapper.LanguagesDtoMapper"/&gt;
  </code></pre>
  
  <p>But whatever I do, I keep getting the following error message:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.project.infrastructure.dtomapper.DtoMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=languagesDtoMapper)}
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014)
  </code></pre>
  
  <p><strong>Structure of the project:</strong></p>
  
  <p>in the controller : </p>
  
  <pre><code> @Autowired
   @Qualifier("languagesDtoMapper")
   private DtoMapper&lt;Languages, LanguagesTableDto&gt; partnerLanguageDtoMapper;
  </code></pre>
  
  <p>Classes:</p>
  
  <pre><code>@Component("languagesDtoMapper")
  public class LanguagesDtoMapper extends AbstractDtoMapper&lt;Languages, LanguagesDto&gt; {
  
  public abstract class AbstractDtoMapper&lt;Source, Target&gt; implements DtoMapper&lt;Source, Target&gt; {
  
  public interface DtoMapper&lt;Source, Target&gt; {
  
  &lt;context:annotation-config /&gt;
  &lt;context:component-scan base-package="com.project"/&gt;
  </code></pre>
  
  <p><strong>Any ideas are welcome</strong></p>