. ____ _ __ _ _ / \ / ' __ _ () __ __ _ \ \
(() _ _ | '_ |' | | ' / `| \ \ \
\ / __ ) | |) | | | | | || ( | |)))) '| | .__ | | | | | | _ , | / / / / ========= | | ============== | / = / / < em> / / :: Spring Boot :: (v2.4.1)
2021-01-13 10: 43: 21.414 INFO 17304 --- [main] cscgateway.CloudGatewayApplication: запуск CloudGatewayApplication с использованием Java 1.8.0_271 на Ajinas с PID 17304 (D: \ microservice \ cloud-gateway \ target \ classes запущен пользователь в D: \ microservice \ cloud-gateway) 2021-01-13 10: 43: 21.421 INFO 17304 --- [main] cscgateway.CloudGatewayApplication: Активный профиль не установлен, возврат к профилям по умолчанию: по умолчанию 2021-01- 13 10: 43: 22.659 ПРЕДУПРЕЖДЕНИЕ 17304 --- [main] osboot.actuate.endpoint.EndpointId: Идентификатор конечной точки 'hystrix.stream' содержит недопустимые символы, перейдите к допустимому формату. 2021-01-13 10: 43: 23.161 ПРЕДУПРЕЖДЕНИЕ 17304 --- [main] onfigReactiveWebServerApplicationContext: исключение во время инициализации контекста - отмена попытки обновления: org.springframework.beans.factory.BeanDefinitionStoreException: не удалось обработать кандидатов на импорт для класса конфигурации [com .study.cloud.gateway.CloudGatewayApplication]; вложенное исключение - java.io.FileNotFoundException: ресурс пути к классу [org / springframework / boot / autoconfigure / web / ServerPropertiesAutoConfiguration.class] не может быть открыт, потому что он не существует 2021-01-13 10: 43: 23.198 INFO 17304 --- [main] ConditionEvaluationReportLoggingListener:
Ошибка запуска ApplicationContext. Чтобы отобразить отчет об условиях, повторно запустите приложение с включенной отладкой. 2021-01-13 10: 43: 23.261 ОШИБКА 17304 --- [main] o.s.boot.SpringApplication: сбой при запуске приложения
4.0.0 org.springframework.boot spring-boot-starter-parent 2.4.1 com.study cloud-gateway 0.0.1-SNAPSHOT cloud-gateway Демонстрационный проект для микросервисов Spring Boot
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
@SpringBootApplication
@EnableEurekaClient
@EnableHystrix
public class CloudGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(CloudGatewayApplication.class, args);
}
}
spring:
application:
name: GATEWAY-SERVICE
cloud:
gateway:
routes:
- id: order-service
uri: lb://ORDER-SERVICE
predicates:
- Path=/order/**
filters:
- name: Circuit-Breaker
args:
name: order-service
fallbackuri: forward:/orderFallBack
- id: payment-service
uri: lb://PAYMENT-SERVICE
predicates:
- Path=/payment/**
filters:
- name: Circuit-Breaker
args:
name: payment-service
fallbackuri: forward:/orderFallBack
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
hostname: localhost
server:
port: 8989
management:
endpoints:
web:
exposure:
include: hystrix.stream
hystrix:
command:
fallbackcmd:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000
Я столкнулся с аналогичной проблемой, моя была связана с импортом зависимостей maven. Попробуйте запустить приложение, добавив следующие зависимости:
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>2020.0.0</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-hystrix -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
<version>1.4.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>