title: Java Spring Boot Application: Error creating bean with name, expected at least 1 bean which qualifies as autowire candidate for this dependenc
body: <p>I'm new to Spring boot, I have developed my first application which received data from XML and queries Oracle DB, JPA.</p>
  
  <p><strong>I'm getting the following error:</strong></p>
  
  <pre><code>[main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inlandPricingRestController': Unsatisfied dependency expressed through field 'inlandPricingService': Error creating bean with name 'inlandPricingServiceImpl': Unsatisfied dependency expressed through field 'inlandPricingDAO': Error creating bean with name 'inlandPricingDAO': Cannot create inner bean '(inner bean)#1386313f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager';
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1386313f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument;
   nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' is defined;
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'inlandPricingDAO': Cannot create inner bean '(inner bean)#1386313f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager';
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1386313f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument;
   nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' is defined;
   nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inlandPricingServiceImpl': Unsatisfied dependency expressed through field 'inlandPricingDAO': Error creating bean with name 'inlandPricingDAO': Cannot create inner bean '(inner bean)#1386313f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager';
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1386313f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument;
   nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' is defined;
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'inlandPricingDAO': Cannot create inner bean '(inner bean)#1386313f' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager';
   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1386313f': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument;
   nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' is defined
  
  org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'inlandPricingRestController': Unsatisfied dependency expressed through field 'inlandPricingService': No qualifying bean of type [com.inlandpricinglocationauditor.dao.InlandPricingService] found for dependency [com.inlandpricinglocationauditor.dao.InlandPricingService]: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.inlandpricinglocationauditor.dao.InlandPricingService] found for dependency [com.inlandpricinglocationauditor.dao.InlandPricingService]:
  </code></pre>
  
  <p><strong>Here're my project files:</strong></p>
  
  <p>Application.java:</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  
  @SpringBootApplication
  public class Application {
  
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  
  }
  </code></pre>
  
  <p>InlandPricingRestController.java:</p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  public class InlandPricingRestController {
  
      @Autowired
      InlandPricingService inlandPricingService;
  
      @RequestMapping(path = "/inlandlocation", method = RequestMethod.GET)
      public String hello() {
          return "Hello Mudassir!";
      }
  
      @RequestMapping(path = "/inlandlocationPOSTtest1", method = RequestMethod.POST, consumes = { "application/xml" })
      public InlandDBStructure postMethodXMLreturnXML1(
              @RequestBody InlandDBStructure list) {
  
          InlandDBStructure InlandCY = list;
          System.out.println("SOP : post Method started . Name "+ InlandCY.geteffective_dt());
          return InlandCY;
      }
  
      @RequestMapping(path = "/inlandlocationReal", method = RequestMethod.POST, consumes = { "application/xml" })
      public String postMethodXMLreturnXML2(@RequestBody InlandDBStructure list) {
  
          InlandDBStructure InlandCY = list;
          System.out.println("SOP : post Method started . Name "+ InlandCY.geteffective_dt());
          return inlandPricingService.findByGeoIDEffectiveExpiryDate(InlandCY.gethub_geoid(), InlandCY.geteffective_dt(),InlandCY.getexpiry_dt());
  
      }
  
  }
  </code></pre>
  
  <p>InlandDBStructure.java:</p>
  
  <pre><code>import javax.xml.bind.annotation.XmlAttribute;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  
  /*public class InlandDBStructure {
  
  }
  */
  
  
  @XmlRootElement(name = "InlandDBStructure")
  public class InlandDBStructure {  
      private String hub_geoid;
      private String effective_dt;
      private String expiry_dt;
      private String last_updated_dt;
  
      public InlandDBStructure() {}  
      public InlandDBStructure(String hUB_GEOID, String eFFECTIVE_DT, String eXPIRY_DT, String lAST_UPDATED_BY) {  
          super();  
          this.hub_geoid = hUB_GEOID;  
          this.effective_dt = eFFECTIVE_DT;  
          this.expiry_dt = eXPIRY_DT;
          this.last_updated_dt = lAST_UPDATED_BY;
      }
      @XmlAttribute 
      public String gethub_geoid() {
          return hub_geoid;
      }
      public void sethub_geoid(String hUB_GEOID) {
          hub_geoid = hUB_GEOID;
      }
      @XmlElement 
      public String geteffective_dt() {
          return effective_dt;
      }
      public void seteffective_dt(String eFFECTIVE_DT) {
          effective_dt = eFFECTIVE_DT;
      }
      @XmlElement 
      public String getexpiry_dt() {
          return expiry_dt;
      }
      public void setexpiry_dt(String eXPIRY_DT) {
          expiry_dt = eXPIRY_DT;
      }
      @XmlElement 
      public String getlast_updated_dt() {
          return last_updated_dt;
      }
      public void setlast_updated_dt(String lAST_UPDATED_BY) {
          last_updated_dt = lAST_UPDATED_BY;
      }  
  
  
  }
  </code></pre>
  
  <p>InlandPricingDAO.java:</p>
  
  <pre><code>import org.springframework.data.jpa.repository.Query;
  import org.springframework.data.repository.CrudRepository;
  import org.springframework.data.repository.query.Param;
  import org.springframework.stereotype.Repository;
  
  @Repository
  public interface InlandPricingDAO extends CrudRepository&lt;InlandPricingDB, Long&gt;{
  
      @Query(value="SELECT HUB_GEOID from INLAND_CY where HUB_GEOID=:hubgeoid AND EFFECTIVE_DT &lt;= TO_DATE(:effectivedate,'dd-mm-yyyy') AND EXPIRY_DT &gt;= TO_DATE(:exiprydate,'DD-MM-YYYY')",nativeQuery = true)
      String findByGeoIDEffectiveExpiryDate(@Param("hubgeoid") String hubgeoid,@Param("effectivedate") String effectivedate ,@Param("exiprydate") String exiprydate);
  
  
  }
  </code></pre>
  
  <p>InlandPRicingDetailRepository.java:</p>
  
  <pre><code>public interface InlandPricingDetailRepository  extends JpaRepository&lt;InlandPricingDB, Long&gt;{
  
  }
  </code></pre>
  
  <p>InlandPricingService.java:</p>
  
  <pre><code>public interface InlandPricingService {
      List&lt;InlandPricingDB&gt; getAllDetails();
      String findByGeoIDEffectiveExpiryDate(String hubgeoid, String effectivedate, String exiprydate);
  }
  </code></pre>
  
  <p>InlandPricingServiceImpls.java:</p>
  
  <pre><code>@Service
  public class InlandPricingServiceImpl implements InlandPricingService{
  
      public InlandPricingServiceImpl() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      @Autowired
      private DataSource dataSource;
  
      @Autowired
      private InlandPricingDAO inlandPricingDAO;
  
      @Autowired
      private InlandPricingDetailRepository inlandPricingDetailRepository;
  
      @Override 
      public String findByGeoIDEffectiveExpiryDate(String hubgeoid, String effectivedate, String exiprydate) {
          return inlandPricingDAO.findByGeoIDEffectiveExpiryDate(hubgeoid,effectivedate,exiprydate);
      }
  
       @Override               
          public List&lt;InlandPricingDB&gt; getAllDetails() {
              return inlandPricingDetailRepository.findAll();
          }
  
       public InlandPricingDetailRepository getInlandPricingDetailRepository() {
              return inlandPricingDetailRepository;
          }
  
          public void setInlandPricingDetailRepository(InlandPricingDetailRepository inlandPricingDetailRepository) {
              this.inlandPricingDetailRepository = inlandPricingDetailRepository;
          }
  
          public InlandPricingDAO getInlandPricingDAO() {
              return inlandPricingDAO;
          }
  
          public void setInlandPricingDAO(InlandPricingDAO inlandPricingDAO) {
              this.inlandPricingDAO = inlandPricingDAO;
          }       
  
          public DataSource getDataSource() {
              return dataSource;
          }
  
          public void setDataSource(DataSource dataSource) {
              this.dataSource = dataSource;
          }
  }
  </code></pre>
  
  <p>InlandPricingDB.java:</p>
  
  <pre><code>import java.util.Date;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.Table;
  
  import org.springframework.data.annotation.Id;
  
  
  /**
   * The persistent class for the INLANCY_CY VIP database table.
   * 
   */
  
  @Entity
  @Table(name = "INLAND_CY")
  public class InlandPricingDB {
         @Id
          @Column(name = "HUB_GEOID")
          private String hub_geo_id;
  
          @Column(name = "EFFECTIVE_DT")
          private Date effective_dt;
  
          @Column(name = "EXPIRY_DT")
          private Date expitry_dt;
  
          @Column(name = "LAST_UPDATED_BY")
          private String last_updated_by;
  
          public String getHub_geo_id() {
              return hub_geo_id;
          }
  
          public void setHub_geo_id(String hub_geo_id) {
              this.hub_geo_id = hub_geo_id;
          }
  
          public Date getEffective_dt() {
              return effective_dt;
          }
  
          public void setEffective_dt(Date effective_dt) {
              this.effective_dt = effective_dt;
          }
  
          public Date getExpitry_dt() {
              return expitry_dt;
          }
  
          public void setExpitry_dt(Date expitry_dt) {
              this.expitry_dt = expitry_dt;
          }
  
          public String getLast_updated_by() {
              return last_updated_by;
          }
  
          public void setLast_updated_by(String last_updated_by) {
              this.last_updated_by = last_updated_by;
          }
  }
  </code></pre>
  
  <p>Application.properties</p>
  
  <pre><code>server.port=9000
  
  spring.unbilled.read.datasource.url=jdbc:oracle:thin:@localhost:1521/xe
  spring.unbilled.read.datasource.username=test
  spring.unbilled.read.datasource.password=test
  spring.unbilled.read.datasource.driver-class-name=oracle.jdbc.OracleDriver
  </code></pre>
  
  <p>What am I doing wrong?</p>