title: Field Mapper could not be found, Consider defining a bean
body: <p>Customer service impl</p>
  <pre><code>package com.application.service.impl;
  
  @Service
  public class CustomerServiceImpl implements CustomerService {
  
  @Autowired
  private CustomerRepository custRepo;
  
  @Autowired
  private CustomerMapper mapper;
  
  @Autowired
  private HMergeMapper mergeMapper;
  
  @Override
  public CustomerViewData addCustomer(CustomerData custData) {
      Customer cr = this.mapper.customerDataToCustomer(custData);
      cr = this.custRepo.save(cr);
      return this.mapper.fromCustToCustViewData(cr);
  }
  }
  </code></pre>
  <p>Customer Service interface</p>
  <pre><code>package com.application.service;
  
  @Component
  public interface CustomerService {
  
  CustomerViewData addCustomer(CustomerData custData);
  
  }
  </code></pre>
  <p>Customer Mapper</p>
  <pre><code>package com.application.mapper;
  
  @Mapper(componentModel = &quot;spring&quot;)
  public interface CustomerMapper {
  CustomerMapper INSTANCE = Mappers.getMapper(CustomerMapper.class);
  
  CustomerViewData fromCustToCustViewData(Customer entity);
  }
  </code></pre>
  <p>Main Class</p>
  <pre><code>package com.application;
  
  @EnableSwagger2
  @SpringBootApplication
  @ComponentScan(basePackages = { &quot;com.application&quot;, &quot;com.application.mapper&quot; })
  @EnableJpaRepositories(basePackages = {&quot;com.application.repository&quot;})
  public class Application {
  
      public static void main(String[] args) throws Exception {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  <p>Error -</p>
  <hr />
  <p>APPLICATION FAILED TO START</p>
  <hr />
  <p>Description:</p>
  <p>Field mapper in com.application.service.impl.CustomerServiceImpl required a bean of type 'com.application.mapper.CustomerMapper' that could not be found.</p>
  <p>Action:</p>
  <p>Consider defining a bean of type 'com.application.mapper.CustomerMapper' in your configuration.</p>
  <pre><code>Note - Package structure is Main Class in com.appliaction,
   Mapper class in com.application.mapper, 
   CustomerService class in com.application.service,
   CustomerServiceImpl class in com.application.service.impl
  </code></pre>