有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java不使用SpringBoot就可以使用SpringCloudZuul吗?

我想使用Spring Cloud Zuul而不使用SpringBoot。我们有一个使用Spring的现有项目,但是我在配置Zuul而不配置SpringBootApplication时遇到了麻烦

使用@EnableZuulProxy注释时,出现以下错误:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.netflix.zuul.ZuulProxyConfiguration': Unsatisfied dependency expressed through field 'discovery'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

No qualifying bean of type 'org.springframework.cloud.client.discovery.DiscoveryClient' available

为什么它需要discovery客户端

我可以在没有spring boot的情况下使用spring cloud starter zuul依赖项吗


共 (1) 个答案