title: I am getting BeanFactory error: NoSuchBeanDefinitionException and I can't figure out how to solve it
body: <p>I was given the task to work on an existing AngularJS SPA (app B). This app uses code from another app (app B) to get information from the database.  Both; app A and app B use the same database.  the goal is to modify app B to get customers, Locations and Docks from a different database.  My goal it to still use some of the same code that app A uses and to create new code for app B and then access the new database to get the information.</p>
  
  <p>When I try to start the app (Eclipse Oxigen) I get an exception thrown by the BeanFactory.</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contextServiceImpl': Unsatisfied dependency expressed through field <strong>'customersRepo'</strong>; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type <strong>'com.csoln.lv.data.cld.dao.CustomersRepo'</strong> available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}</p>
  </blockquote>
  
  <p>I suspect that the bean isn’t defined in the Spring Context but I don't know how to define it.  I have tried the suggestions found on other posts and nothing works.  I will post the code and relevant files next...</p>
  
  <p>Keep in mind that I am pretty new on Spring, REstful Services, etc.  I hope you can help me solving this error.  Thank you in advance.</p>
  
  <p>SERVICE FILE</p>
  
  <pre><code>package com.csoln.lv.service;
  
  import java.util.List;
  import java.util.Map;
  
  import com.csoln.lv.cld.bo.CustomerBo;
  import com.csoln.lv.cld.bo.DockBo;
  import com.csoln.lv.cld.bo.LocationBo;
  
  public interface ContextService {
  
      public List&lt;CustomerBo&gt; getCustomersFiltered(); 
      public Map&lt;String, CustomerBo&gt; getCustomerMapFiltered();
      public CustomerBo getCustomer(Integer id);
      public List&lt;CustomerBo&gt; getAllCustomers();
      public List&lt;CustomerBo&gt; getCustomers();
      public Map&lt;String, CustomerBo&gt; getCustomerMap();    
      public Map&lt;Integer, CustomerBo&gt; getCustomerMapById();
  
      public List&lt;LocationBo&gt; getLocationsFiltered(CustomerBo customer);  
      public Map&lt;String, LocationBo&gt; getLocationMapFiltered(CustomerBo customer);
      public Map&lt;Integer, LocationBo&gt; getLocationMapByIdFiltered(CustomerBo customer);
      public LocationBo getLocation(Integer customerId, Integer id);
      public List&lt;LocationBo&gt; getAllLocations(CustomerBo customer);
      public List&lt;LocationBo&gt; getLocations(CustomerBo customer);
  
      public List&lt;DockBo&gt; getDocksFiltered(LocationBo location);  
      public Map&lt;String, DockBo&gt; getDockMapFiltered(LocationBo location); 
      public Map&lt;Integer, DockBo&gt; getDockMapByIdFiltered(LocationBo location);
      public DockBo getDock(Integer customerId, Integer locationId, Integer id);
      public List&lt;DockBo&gt; getAllDocks(LocationBo location);
      public List&lt;DockBo&gt; getDocks(LocationBo location);
  
      public List&lt;DockBo&gt; getSubDocks(DockBo dock);
      public Map&lt;String, DockBo&gt; getSubDockMap(DockBo dock);
      public Map&lt;Integer, DockBo&gt; getSubDockMapById(DockBo dock);
  }
  </code></pre>
  
  <hr>
  
  <p>SERVICE IMPL</p>
  
  <pre><code>package com.csoln.lv.service;
  
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
  import java.util.SortedMap;
  import java.util.TreeMap;
  import java.util.stream.Collectors;
  import java.util.stream.Stream;
  
  import org.apache.log4j.Logger;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.data.domain.Example;
  import org.springframework.data.domain.Sort;
  import org.springframework.data.domain.Sort.Direction;
  import org.springframework.security.core.authority.SimpleGrantedAuthority;
  import org.springframework.security.core.context.SecurityContextHolder;
  import org.springframework.stereotype.Service;
  
  // For Liveview
  import com.csoln.lv.cld.bo.CustomerBo;
  import com.csoln.lv.cld.bo.DockBo;
  import com.csoln.lv.cld.bo.LocationBo;
  import com.csoln.lv.data.cld.dao.CustomersRepo;
  import com.csoln.lv.data.cld.dao.DocksRepo;
  import com.csoln.lv.data.cld.dao.LocationsRepo;
  import com.csoln.lv.data.dom.Customers;
  import com.csoln.lv.data.dom.Docks;
  import com.csoln.lv.data.dom.Locations;
  import com.csoln.lv.data.id.DockId;
  import com.csoln.lv.data.id.LocationId;
  
  @Service
  @SuppressWarnings("unchecked")
  public class ContextServiceImpl implements ContextService {
  
      private static Logger log = Logger.getLogger(ContextServiceImpl.class);
  
      @Autowired
      private CustomersRepo customersRepo;
      @Autowired
      private LocationsRepo locationsRepo;
      @Autowired
      private DocksRepo docksRepo;
  
      private String customerPrefix = "C_";
      private String locationPrefix = "L_";
      private String dockPrefix = "D_";
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getCustomers()
       */
      @Override
      public List&lt;CustomerBo&gt; getCustomersFiltered() {
          List&lt;String&gt; filter = this.getGrantedAuthorities(this.customerPrefix);
          List&lt;CustomerBo&gt; customers = new ArrayList&lt;&gt;();
          List&lt;CustomerBo&gt; clients = this.getCustomers(true);
          if( clients != null &amp;&amp; filter != null &amp;&amp; clients.size() &gt; 0 &amp;&amp; filter.size() &gt; 0 ) {
              Stream&lt;CustomerBo&gt; stream = clients.stream().filter( entry -&gt; filter.contains(entry.getId().toString()));
              customers = stream.collect(Collectors.toList());
          }
          if( log.isDebugEnabled() ) {            
              log.debug(clients);
          }
          return customers;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getCustomerMap()
       */
      @Override
      public Map&lt;String, CustomerBo&gt; getCustomerMapFiltered() {
          List&lt;CustomerBo&gt; customers = this.getCustomersFiltered();
          Map&lt;String, CustomerBo&gt; clients = new HashMap&lt;&gt;();
          if( customers != null &amp;&amp; customers.size() &gt; 0 ) {
              customers.forEach(c -&gt; clients.put(c.getAbbreviation(), c));
          }
          if( log.isDebugEnabled() ) {            
              log.debug(clients);
          }
          return clients;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.ContextService#getCustomer(java.lang.Integer)
       */
      @Override
      public CustomerBo getCustomer(Integer id) {
          return new CustomerBo().toBo(this.customersRepo.findOne(id));
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.ContextService#getCustomers()
       */
      @Override
      public List&lt;CustomerBo&gt; getAllCustomers() {
          List&lt;CustomerBo&gt; customers = this.getCustomers(false);
          return customers;
      }
  
      @Override
      public List&lt;CustomerBo&gt; getCustomers() {
          List&lt;CustomerBo&gt; customers = this.getCustomers(true);
          return customers;
      }
  
      private List&lt;CustomerBo&gt; getCustomers(Boolean active) {
          Example&lt;Customers&gt; example = null;
          List&lt;Customers&gt; entities = null;
          if( active ) {
              Customers probe = new Customers();
              probe.setActiveEntry(active);
              example = Example.of(probe);
              entities = this.customersRepo.findAll(example, new Sort(Direction.ASC, "shortName"));
          } else {
              entities = this.customersRepo.findAll(new Sort(Direction.ASC, "shortName"));
          }
  
          List&lt;CustomerBo&gt; customers = new ArrayList&lt;&gt;();
          if( entities != null &amp;&amp; entities.size() &gt; 0 ) {
              entities.forEach(c -&gt; {
                  customers.add(new CustomerBo().toBo(c));
              });
          }
          return customers;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getCustomerMapById()
       */
      public Map&lt;Integer, CustomerBo&gt; getCustomerMapById() {
          SortedMap&lt;Integer, CustomerBo&gt; clients = new TreeMap&lt;&gt;();
          List&lt;CustomerBo&gt; customers = this.getAllCustomers();
          if( customers != null &amp;&amp; !customers.isEmpty() ) {
              customers.forEach(c -&gt; clients.put(c.getId(), c) );
          }
          if( log.isDebugEnabled() ) {            
              log.debug(clients);
          }
          return clients;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getCustomerMapByAbbreviation()
       */
      @Override
      public Map&lt;String, CustomerBo&gt; getCustomerMap() {
          SortedMap&lt;String, CustomerBo&gt; clients = new TreeMap&lt;&gt;();
          List&lt;CustomerBo&gt; customers = this.getAllCustomers();
          if( customers != null &amp;&amp; !customers.isEmpty() ) {
              customers.forEach(c -&gt; clients.put(c.getAbbreviation(), c));
          }
          if( log.isDebugEnabled() ) {            
              log.debug(clients);
          }
          return clients;
      }
  
  
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getLocations(com.csoln.web.bean.CustomerBean)
       */
      @Override
      public List&lt;LocationBo&gt; getLocationsFiltered(CustomerBo customer) {
          List&lt;String&gt; filter = this.getGrantedAuthorities(this.locationPrefix + customer.getId() + "_");     
          List&lt;LocationBo&gt; locations = new ArrayList&lt;&gt;();
          List&lt;LocationBo&gt; ls = this.getLocations(customer);
          if( ls != null &amp;&amp; !ls.isEmpty() ) {
              locations = ls.stream().filter( l-&gt; filter.contains(l.getId().toString())).collect(Collectors.toList());
              Collections.sort(locations, (l1, l2) -&gt; (l1.getId() &lt; l2.getId())?1:0);
          }
          if( log.isDebugEnabled() ) {
  
          }
          return locations;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getLocationMap(com.csoln.web.bean.CustomerBean)
       */
      @Override
      public Map&lt;String, LocationBo&gt; getLocationMapFiltered(CustomerBo customer) {
          Map&lt;String, LocationBo&gt; locations = new TreeMap&lt;&gt;();
          List&lt;LocationBo&gt; locs = this.getLocationsFiltered(customer);
          if( locs != null &amp;&amp; !locs.isEmpty() ) {
              locs.forEach(l -&gt; locations.put(l.getAbbreviation(), l));           
          }
          log.debug(locations);
          return locations;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getLocationMapById(com.csoln.web.bean.CustomerBean, java.lang.String)
       */
      @Override
      public Map&lt;Integer, LocationBo&gt; getLocationMapByIdFiltered(CustomerBo customer) {
          Map&lt;Integer, LocationBo&gt; locations = new TreeMap&lt;&gt;();
          List&lt;LocationBo&gt; locs = this.getLocationsFiltered(customer);
          if( locs != null &amp;&amp; !locs.isEmpty() ) {
              locs.forEach(l -&gt; locations.put(l.getId(), l));         
          }
          log.debug(locations);
          return locations;
      }   
  
      @Override
      public LocationBo getLocation(Integer customerId, Integer id) {
          LocationId locId = new LocationId(customerId, id);
          return new LocationBo().toBo(this.locationsRepo.findOne(locId));
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.ContextService#getLocations(com.csoln.common.bo.CustomerBo)
       */
      @Override
  //  @Cacheable(cacheNames = "context", key="#root.target+#root.methodName+#customer")
      public List&lt;LocationBo&gt; getAllLocations(CustomerBo customer) {
          List&lt;LocationBo&gt; locations = this.getLocations(customer, false);
          return locations;
      }
  
      @Override
      public List&lt;LocationBo&gt; getLocations(CustomerBo customer) {
          List&lt;LocationBo&gt; locations = this.getLocations(customer, true);
          return locations;
      }
  
      private List&lt;LocationBo&gt; getLocations(CustomerBo customer, Boolean active) {
          Locations probe = new Locations(customer.getId());
          if( active ) {
              probe.setActiveEntry(active);
          }
          List&lt;Locations&gt; entities = this.locationsRepo.findAll(Example.of(probe), new Sort(Direction.ASC, "shortName"));
          List&lt;LocationBo&gt; locations = new ArrayList&lt;&gt;();
          if( entities != null &amp;&amp; entities.size() &gt; 0 ) {
              entities.forEach( l-&gt;{
                  locations.add(new LocationBo().toBo(l));
              });
          }
          return locations;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getDocks(com.csoln.web.bean.LocationBean)
       */
      @Override
      public List&lt;DockBo&gt; getDocksFiltered(LocationBo location) {
          List&lt;String&gt; filter = this.getGrantedAuthorities(this.dockPrefix + location.getCustomerId() + "_" + location.getId() + "_");
  
          List&lt;DockBo&gt; docs = this.getDocks(location);
  
          List&lt;DockBo&gt; docks = new ArrayList&lt;&gt;();
          if( docs != null &amp;&amp; filter != null &amp;&amp; !docs.isEmpty() ) {           
              docks = docs.stream().filter( d-&gt; filter.contains(d.getId().toString())).collect(Collectors.toList());
              Collections.sort(docks, (d1, d2) -&gt; (d1.getId() &lt; d2.getId())?1:0);
          }
  
          if( log.isDebugEnabled() ) {
              log.debug(docks);
          }
          return docks;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getDockMap(com.csoln.web.bean.LocationBean)
       */
      @Override
      public Map&lt;String, DockBo&gt; getDockMapFiltered(LocationBo location) {        
          Map&lt;String, DockBo&gt; docks = new TreeMap&lt;&gt;();
          List&lt;DockBo&gt; dcks = this.getDocksFiltered(location);        
          if( dcks != null &amp; !dcks.isEmpty() ) {
              dcks.forEach(d -&gt; docks.put(d.getAbbreviation(), d));
          }       
          if( log.isDebugEnabled() ) {
              log.debug(docks);
          }
          return docks;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getDockMapById(com.csoln.web.bean.LocationBean, java.lang.String)
       */
      @Override
      public Map&lt;Integer, DockBo&gt; getDockMapByIdFiltered(LocationBo location) {
          Map&lt;Integer, DockBo&gt; docks = new TreeMap&lt;&gt;();
          List&lt;DockBo&gt; dcks = this.getDocksFiltered(location);        
          if( dcks != null &amp; !dcks.isEmpty() ) {
              dcks.forEach(d -&gt; docks.put(d.getId(), d));
          }       
          if( log.isDebugEnabled() ) {
              log.debug(docks);
          }
          return docks;
      }
  
      @Override
      public DockBo getDock(Integer customerId, Integer locationId, Integer id) {
          DockId dockId = new DockId(customerId, locationId, id);
          return new DockBo().toBo(this.docksRepo.findOne(dockId));
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.ContextService#getDocks(com.csoln.common.bo.LocationBo)
       */
      @Override
  //  @Cacheable(cacheNames = "context", key="#root.target+#root.methodName+#location")
      public List&lt;DockBo&gt; getAllDocks(LocationBo location) {
          List&lt;DockBo&gt; docks = this.getDocksIfActive(location.getCustomerId(), location.getId(), false);
          return docks;
      }
  
      @Override
      public List&lt;DockBo&gt; getDocks(LocationBo location) {
          List&lt;DockBo&gt; docks = this.getDocksIfActive(location.getCustomerId(), location.getId(), true);
          return docks;
      }
  
      private List&lt;DockBo&gt; getDocksIfActive(Integer customerId, Integer locationId, Boolean active) {
          List&lt;DockBo&gt; docks = new ArrayList&lt;&gt;();
          List&lt;Docks&gt; entities = null;
          Docks probe = new Docks(customerId, locationId);
          if( active ) {
              probe.setActiveEntry(active);
          } 
          entities = this.docksRepo.findAll(Example.of(probe), new Sort(Direction.ASC, "shortName"));
          List&lt;DockBo&gt; subdocks = new ArrayList&lt;&gt;();
          if( entities != null &amp;&amp; entities.size() &gt; 0 ) {
              entities.forEach( d-&gt; {
                  subdocks.addAll(getSubDocks(new DockBo().toBo(d)));
                  docks.add(new DockBo().toBo(d));            
              });
          }
          subdocks.forEach(sd -&gt; {
              docks.remove(sd);
          });     
          return docks;
      }
  
      /* (non-Javadoc)    
       * @see com.csoln.service.data.ContextService#getSubDocks(com.csoln.web.bean.DockBean)
       */
      @Override
  //  @Cacheable(cacheNames = "context", key="#root.target+#root.methodName+#dock")
      public List&lt;DockBo&gt; getSubDocks(DockBo dock) {
          List&lt;DockBo&gt; docks = new ArrayList&lt;&gt;();
          List&lt;Docks&gt; dcs = this.docksRepo.findSubDocksForDock(dock.getCustomerId(), dock.getLocationId(), dock.getId());
          if( dcs != null ) {
              dcs.forEach(d -&gt;docks.add(new DockBo().toBo(d)));
          }       
          return docks;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getSubDockMap(com.csoln.web.bean.DockBean)
       */
      @Override
      public Map&lt;String, DockBo&gt; getSubDockMap(DockBo dock) {
          Map&lt;String, DockBo&gt; docks = new TreeMap&lt;&gt;();
          List&lt;DockBo&gt; dcs = this.getSubDocks(dock);
          if( dcs != null ) {
              dcs.forEach(d -&gt;docks.put(d.getAbbreviation(), d));
          }
          return docks;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.service.data.ContextService#getSubDockMapById(com.csoln.web.bean.DockBean, java.lang.String)
       */
      @Override
      public Map&lt;Integer, DockBo&gt; getSubDockMapById(DockBo dock) {
          Map&lt;Integer, DockBo&gt; docks = new TreeMap&lt;&gt;();
          List&lt;DockBo&gt; dcs = this.getSubDocks(dock);
          if( dcs != null ) {
              dcs.forEach(d -&gt;docks.put(d.getId(), d));
          }
          return docks;
      }
  
      private List&lt;String&gt; getGrantedAuthorities(String prefix) {
          List&lt;String&gt; filter = new ArrayList&lt;&gt;();        
          Collection&lt;SimpleGrantedAuthority&gt; authorities =  (Collection&lt;SimpleGrantedAuthority&gt;) SecurityContextHolder.getContext().getAuthentication().getAuthorities();
          Stream&lt;SimpleGrantedAuthority&gt; filtered = authorities.stream().filter(a -&gt; a.getAuthority().startsWith(prefix));
          filtered.forEach(a -&gt; filter.add(a.getAuthority().replace(prefix, "")));
          log.debug("Filtered by User:  " + filter);
          return filter;
      }
  
      /**
       * @return the customerPrefix
       */
      public String getCustomerPrefix() {
          return customerPrefix;
      }
  
      /**
       * @param customerPrefix the customerPrefix to set
       */
      public void setCustomerPrefix(String customerPrefix) {
          this.customerPrefix = customerPrefix;
      }
  
      /**
       * @return the locationPrefix
       */
      public String getLocationPrefix() {
          return locationPrefix;
      }
  
      /**
       * @param locationPrefix the locationPrefix to set
       */
      public void setLocationPrefix(String locationPrefix) {
          this.locationPrefix = locationPrefix;
      }
  
      /**
       * @return the dockPrefix
       */
      public String getDockPrefix() {
          return dockPrefix;
      }
  
      /**
       * @param dockPrefix the dockPrefix to set
       */
      public void setDockPrefix(String dockPrefix) {
          this.dockPrefix = dockPrefix;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>THE DAO</p>
  
  <pre><code>package com.csoln.lv.data.cld.dao;
  
  import java.util.List;
  
  import org.springframework.data.jpa.repository.JpaRepository;
  import org.springframework.data.jpa.repository.Query;
  import org.springframework.data.repository.query.Param;
  
  import com.csoln.lv.data.dom.Customers;
  import com.csoln.data.repository.SyncRepository;
  
  public interface CustomersRepo extends JpaRepository&lt;Customers, Integer&gt;, SyncRepository&lt;Customers&gt; {
  
      public List&lt;Customers&gt; findByAbbreviationAndActiveEntryTrue(String abbreviation);
      public List&lt;Customers&gt; findByIdInAndActiveEntryTrue(List&lt;Integer&gt; customerIds);
  
      @Query("SELECT new Customers(id, abbreviation, shortName, longName) FROM Customers WHERE activeEntry = true ORDER BY abbreviation ASC")
      public List&lt;Customers&gt; findDisplayInfo();
  
      @Query("SELECT new Customers(id, abbreviation, shortName, longName) FROM Customers WHERE id IN :customerIds AND activeEntry = true")
      public List&lt;Customers&gt; findDisplayInfoByIdIn(@Param("customerIds") List&lt;Integer&gt; customerIds);
  
      @Query("SELECT new Customers(id, abbreviation, shortName, longName) FROM Customers WHERE abbreviation IN :abbreviations AND activeEntry = true")
      public List&lt;Customers&gt; findDisplayInfoByAbbrIn(@Param("abbreviations") List&lt;String&gt; abbreviations);
  }
  </code></pre>
  
  <hr>
  
  <p>CUSTOMERS</p>
  
  <pre><code>package com.csoln.lv.data.dom;
  
  import javax.persistence.Entity;
  import javax.persistence.EntityListeners;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  import org.springframework.data.domain.Persistable;
  
  import com.csoln.data.common.AbstractAbbreviation;
  import com.csoln.data.listener.SimpleSequenceId;
  import com.csoln.data.listener.SimpleSequenceIdListener;
  import com.fasterxml.jackson.annotation.JsonIgnore;
  
  /**
   * @author eduardo.serrano
   *
   */
  @Entity
  @Table(name = Customers.TABLE)
  @EntityListeners(SimpleSequenceIdListener.class)
  public class Customers extends AbstractAbbreviation implements Persistable&lt;Integer&gt;, SimpleSequenceId {
  
      public static final String TABLE = "customers";
      private static final long serialVersionUID = -8559335312619610990L;
  
      @Id
      private Integer id;
  
      public Customers() {
          super();
      }
  
      public Customers(Integer id, String abbreviation, String shortName, String longName) {
          super();
          this.id = id;
          this.setAbbreviation(abbreviation);
          this.setShortName(shortName);
          this.setLongName(longName);
      }
      /**
       * @return the id
       */
      public Integer getId() {
          return id;
      }
      /**
       * @param id the id to set
       */
      public void setId(Integer id) {
          this.id = id;
      }
      /* (non-Javadoc)
       * @see org.springframework.data.domain.Persistable#isNew()
       */
      @Override
      @JsonIgnore
      public boolean isNew() {
          return this.id == null;
      }
  
      /* (non-Javadoc)
       * @see com.csoln.data.common.AbstractAuditable#toString()
       */
      @Override
      public String toString() {
          return new StringBuilder("\n\r\t\t" + this.getClass().getName() + " - ID: " + this.id + ", " +super.toString()).toString();
      }   
  }
  </code></pre>
  
  <hr>
  
  <p>THE BO</p>
  
  <pre><code>package com.csoln.lv.cld.bo;
  
  import com.csoln.lv.data.dom.Customers;
  import com.csoln.bo.common.AuditableBo;
  
  public class CustomerBo extends AuditableBo&lt;CustomerBo, Customers&gt; {
  
      private static final long serialVersionUID = 6234658974110288240L;
      private Integer id;
      private String abbreviation;
      private String code;
      private String label;
      private Boolean activeEntry;
  
      public CustomerBo() {
          super();
      }
      public CustomerBo(Integer id, String abbreviation, String code, String label) {
          super();
          this.id = id;
          this.abbreviation = abbreviation;
          this.code = code;
          this.label = label;
      }
      /**
       * @return the id
       */
      public Integer getId() {
          return id;
      }
      /**
       * @param id the id to set
       */
      public void setId(Integer id) {
          this.id = id;
      }
      /**
       * @return the abbreviation
       */
      public String getAbbreviation() {
          return abbreviation;
      }
  
      public CustomerBo setAbbreviation(String abbreviation) {
          this.abbreviation = abbreviation;
          return this;
      }
      /**
       * @return the code
       */
      public String getCode() {
          return code;
      }
  
      public CustomerBo setCode(String code) {
          this.code = code;
          return this;
      }
      /**
       * @return the label
       */
      public String getLabel() {
          return label;
      }
  
      public CustomerBo setLabel(String label) {
          this.label = label;
          return this;
      }
      /**
       * @return the activeEntry
       */
      public Boolean getActiveEntry() {
          return activeEntry;
      }
      /**
       * @param activeEntry the activeEntry to set
       */
      public void setActiveEntry(Boolean activeEntry) {
          this.activeEntry = activeEntry;
      }
  
      @SuppressWarnings("unchecked")
      @Override
      public &lt;B extends CustomerBo&gt; B toBo(Customers domain) {
          if( domain != null ) {
              super.toBo(domain);
  
              this.id = domain.getId();
              this.abbreviation = domain.getAbbreviation();
              this.code = domain.getShortName();
              this.label = domain.getLongName();
              this.activeEntry = domain.getActiveEntry();
  
          } 
          return (B) this;
      }
  
      public Customers toDomain() {
          Customers domain = new Customers();
          domain = super.toDomain(domain);
          domain.setId(id);
          domain.setAbbreviation(abbreviation);
          domain.setLongName(this.label);
          domain.setShortName(this.code);
          domain.setActiveEntry(activeEntry);
          return domain;
      }
  
      @Override
      public boolean equals(Object obj) {
          boolean equals = false;
          if( obj instanceof CustomerBo ) {
              CustomerBo i = (CustomerBo)obj;
              equals = (id == i.getId());
          }
          return equals;
      }
  
      @Override
      public int hashCode() {
          return 4000;
      }
  }
  </code></pre>
  
  <hr>
  
  <p>THE ERROR</p>
  
  <pre><code> SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
      org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contextServiceImpl': Unsatisfied dependency expressed through field 'customersRepo'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.csoln.lv.data.cld.dao.CustomersRepo' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
      Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.csoln.lv.data.cld.dao.CustomersRepo' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  </code></pre>
  
  <hr>
  
  <p>THE XML SPRING CONTEXT FILE</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:context="http://www.springframework.org/schema/context"
         xmlns:mvc="http://www.springframework.org/schema/mvc"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xmlns:util="http://www.springframework.org/schema/util"
         xmlns:cache="http://www.springframework.org/schema/cache"
         xsi:schemaLocation="
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context.xsd"&gt;
  
      &lt;context:annotation-config&gt;&lt;/context:annotation-config&gt;
      &lt;bean class="com.csoln.context.CsolnContext" /&gt; 
  
      &lt;import resource="classpath:/props-context.xml"/&gt;
  
      &lt;import resource="classpath:/config/data-context.xml" /&gt;
      &lt;import resource="classpath:/config/livedock-data-context.xml" /&gt;
      &lt;import resource="classpath:/config/security-context.xml" /&gt;
      &lt;import resource="classpath:/config/cache-context.xml" /&gt;
  
      &lt;context:component-scan base-package="
          com.csoln.lookup,
          com.csoln.lv.service"&gt;
      &lt;/context:component-scan&gt;
  
      &lt;bean class="com.csoln.service.ContextServiceImpl" /&gt;
      &lt;bean class="com.csoln.service.CodeServiceImpl" /&gt;
      &lt;bean class="com.csoln.service.ReferenceServiceImpl" /&gt;
  
      &lt;bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider" /&gt;
  &lt;/beans&gt;
  </code></pre>