title: Failed to process import candidates for configuration class; nested exception is java.io.FileNotFoundException
body: <p>Getting error while trying to run Spring Boot Application on Eureka Server.
  Here I am trying to do Fault Tolerance in the Application.</p>
  <p>I have created three Applications:</p>
  <ol>
  <li>CitizenServer</li>
  <li>EurekaServer</li>
  <li>VaccinationServer</li>
  </ol>
  <p>In order to check whether the Fault Tolerance is working or not I have started EurekaServer and Vaccination Server.</p>
  <p><a href="https://i.stack.imgur.com/ZNVuP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZNVuP.png" alt="Here I have closed the CitizenServer" /></a></p>
  <p>Here I have closed the CitizenServer. In order to check the Fault Tolerance.</p>
  <p>pom.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.6.4&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  
  
  
  &lt;groupId&gt;com.example&lt;/groupId&gt;
  &lt;artifactId&gt;MicroserviceVaccinationCenter&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;MicroserviceVaccinationCenter&lt;/name&gt;
  &lt;description&gt;Microservice for Vaccination Center&lt;/description&gt;
  &lt;properties&gt;
      &lt;java.version&gt;11&lt;/java.version&gt;
      &lt;spring-cloud.version&gt;2021.0.1&lt;/spring-cloud.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
          &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
      &lt;/dependency&gt;
      
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
          &lt;artifactId&gt;spring-cloud-starter-hystrix&lt;/artifactId&gt;
          &lt;version&gt;1.4.7.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      
      
  
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
              &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;
                          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
                          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
                      &lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>VaccinationController</p>
  <pre><code>@RestController
  @RequestMapping(&quot;/vaccinationcenter&quot;)
  public class VaccinationCenterController {
  
  @Autowired
  private CenterRepo centerRepo;
  
  @Autowired
  private RestTemplate restTemplate;
  
  @PostMapping(
          path = {&quot;/add&quot;}
      )
      public ResponseEntity&lt;VaccinationCenter&gt; addCitizen(@RequestBody VaccinationCenter vaccinationCenter) {
          VaccinationCenter vaccinationCenterAdded = (VaccinationCenter)this.centerRepo.save(vaccinationCenter);
          return new ResponseEntity&lt;&gt;(vaccinationCenterAdded, HttpStatus.OK);
      }
  
  @GetMapping(path = {&quot;/id/{id}&quot;})
  @HystrixCommand(fallbackMethod = &quot;handleCitizenDownTime&quot;)
      public ResponseEntity&lt;RequiredResponse&gt; getAllDadaBasedonCenterId(@PathVariable Integer id) {
          RequiredResponse requiredResponse = new RequiredResponse();
          VaccinationCenter center = centerRepo.findById(id).get();
          requiredResponse.setCenter(center);
          
  
          List&lt;Citizen&gt; listOfCitizens = restTemplate.getForObject(&quot;http://CITIZEN-SERVICE/citizen/id/&quot;+id, List.class);
          requiredResponse.setCitizens(listOfCitizens);
          return new ResponseEntity&lt;RequiredResponse&gt;(requiredResponse, HttpStatus.OK);
      }
  
  public ResponseEntity&lt;RequiredResponse&gt; handleCitizenDownTime(@PathVariable Integer id) {
      RequiredResponse requiredResponse = new RequiredResponse();
      VaccinationCenter center = centerRepo.findById(id).get();
      requiredResponse.setCenter(center);
      return new ResponseEntity&lt;RequiredResponse&gt;(requiredResponse, HttpStatus.OK);
      
  } }
  </code></pre>
  <p>Output Terminal:</p>
  <pre><code>Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
  2022-03-22 19:37:03.465 ERROR 20100 --- [           main] o.s.boot.SpringApplication               : Application run failed
  
  org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.example.microservice.VaccinationCenter.MicroserviceVaccinationCenterApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
      at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.access$800(ConfigurationClassParser.java:111) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:812) ~[spring-context-5.3.16.jar:5.3.16]
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) ~[na:na]
      at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.4.jar:2.6.4]
      at com.example.microservice.VaccinationCenter.MicroserviceVaccinationCenterApplication.main(MicroserviceVaccinationCenterApplication.java:15) ~[classes/:na]
  Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
      at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:199) ~[spring-core-5.3.16.jar:5.3.16]
      at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[spring-core-5.3.16.jar:5.3.16]
      at org.springframework.core.type.classreading.SimpleMetadataReader.&lt;init&gt;(SimpleMetadataReader.java:49) ~[spring-core-5.3.16.jar:5.3.16]
      at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.3.16.jar:5.3.16]
      at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73) ~[spring-boot-2.6.4.jar:2.6.4]
      at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[spring-core-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:696) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getRelated(ConfigurationClassParser.java:1090) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getAnnotationAttributes(ConfigurationClassParser.java:1071) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.collectImports(ConfigurationClassParser.java:549) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:522) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.3.16.jar:5.3.16]
      at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:600) ~[spring-context-5.3.16.jar:5.3.16]
      ... 19 common frames omitted
  </code></pre>