메인 클래스가있는 maven spring 마이크로 서비스가 있습니다.
@EnableEncryptableProperties
@SpringBootApplication
@EnableDiscoveryClient
public class AccountService {
private static ApplicationContext applicationContext;
public static void main(String[] args) {
applicationContext = SpringApplication.run(AccountService.class, args);
}
}
내 pom.xml에서 앱 등록을 위해 다음 의존성을 추가했습니다.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<version>1.3.5.RELEASE</version>
</dependency>
시작하는 동안 다음 오류가 발생합니다.
[WARN ] 2021-01-11 22:05:50 [main] AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.microservices.accountservice.AccountService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
[ERROR] 2021-01-11 22:05:50 [main] SpringApplication - Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.microservices.accountservice.AccountService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist
이 프로젝트는 다음 Spring 버전을 정의했습니다.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
또한 시작하는 동안 마이크로 서비스는 bootstrap.properties를 사용하여 spring-cloud-config-server와 통신하여 application.properties를 가져옵니다. 이 오류와 관련된 문제는 무엇입니까?