title: cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Spring Boot
body: <p>I am working on a spring boot application. I want to achieve sending some json data to a web api. When I try to run it, the following error comes up. After so many attempts, its not getting resolved. Any help will be much appreciated:</p>
  
  <p><em>Error console:</em></p>
  
  <pre><code>2017-03-31 12:00:36.634  WARN 2972 --- [           main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'oniSavingsApiController': Unsatisfied dependency expressed through field 'oniSavingsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'oniSavingsApiService': Unsatisfied dependency expressed through field 'readSheet'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.oni.excelReader.ReadSheet' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  2017-03-31 12:00:36.634  INFO 2972 --- [           main] o.apache.catalina.core.StandardService   : Stopping service Tomcat
  2017-03-31 12:00:36.654  INFO 2972 --- [           main] utoConfigurationReportLoggingInitializer : 
  
  Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
  2017-03-31 12:00:36.798 ERROR 2972 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
  
  APPLICATION FAILED TO START
  
  Description:
  
  Field readSheet in com.oni.service.OniSavingsApiService required a bean of type 'com.oni.excelReader.ReadSheet' that could not be found.
  </code></pre>
  
  <hr>
  
  <p><em>Application</em></p>
  
  <pre><code>@SpringBootApplication
  @ComponentScan(basePackages = "com.oni.controller, com.oni.service")
  public class Application {
      public static void main(String[] args) {
          SpringApplication.run(Application.class, args);
      }
  }
  </code></pre>
  
  <p><em>Controller</em></p>
  
  <pre><code>@Controller
  public class OniSavingsApiController {
  
      @Autowired
      private OniSavingsApiService oniSavingsService;
  
      @RequestMapping("/")
      public void home() {
          oniSavingsService.oakRestCall();
      }
  }
  </code></pre>
  
  <p><em>Service</em></p>
  
  <pre><code>@Component
  public class OniSavingsApiService {
  
  @Autowired
  private ReadSheet readSheet;
  
  public static final String CUSTOM_INFO = "custominformation";
  public static final String AUTHORIZATION = "Basic";
  
  public void oakRestCall() {
  
      RestTemplate restTemplate = new RestTemplate();
      HttpHeaders headers = new HttpHeaders();
      headers.setContentType(MediaType.APPLICATION_JSON);
      headers.set("Authorization", AUTHORIZATION);
  
      ArrayList&lt;ResponseEntity&lt;ResponseData&gt;&gt; responses = new ArrayList&lt;ResponseEntity&lt;ResponseData&gt;&gt;();
      List&lt;ExcelFields&gt; listOfExcelData = readSheet.getFileContent();
  
      for (ExcelFields ef : listOfExcelData) {
          System.out.println(ef.getId());
          try {
              String json = "";
              String urlString = "";
              /**
              some code here
              **/
          } catch (Exception e) {
          }
      }
  }
  }
  </code></pre>