我正在尝试构建 Spring Cloud 网关服务,并在运行时看到以下错误:-
WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceRegistryEndpoint' defined in class path
resource [org/springframework/cloud/client/serviceregistry/ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Fail
ed to introspect Class [org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@67b6d4ae]
2021-03-19 11:41:23 - INFO
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-19 11:41:24 -ERROR Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceRegistryEndpoint' defined in class path resource [org/springframework/cloud/client/serviceregistry/ServiceRegistryAutoConfiguration$ServiceRegistryEn
dpointConfiguration.class]: Post-processing of merged bean definition failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint] fr
om ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@67b6d4ae]
我的 pom.xml 中有以下依赖项
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-ribbon</artifactId>
</dependency>
</dependencies>
任何建议都会有很大帮助。