Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 外部客户端无法加载服务_Spring_Spring Boot_Spring Cloud Feign - Fatal编程技术网

Spring 外部客户端无法加载服务

Spring 外部客户端无法加载服务,spring,spring-boot,spring-cloud-feign,Spring,Spring Boot,Spring Cloud Feign,在我的项目中,不同的服务被部署为微服务,授权和身份验证在一个公共jar文件中处理,该文件作为一个依赖项添加到每个微服务项目中 微服务之间的通信是通过外部客户端完成的 下面给出了此类服务的Gradle文件 dependencies { compile('org.springframework.boot:spring-boot-starter') compile('org.springframework.cloud:spring-cloud-starter-eureka'){

在我的项目中,不同的服务被部署为微服务,授权和身份验证在一个公共jar文件中处理,该文件作为一个依赖项添加到每个微服务项目中

微服务之间的通信是通过外部客户端完成的

下面给出了此类服务的Gradle文件

dependencies {
    compile('org.springframework.boot:spring-boot-starter')
    compile('org.springframework.cloud:spring-cloud-starter-eureka'){
    compile('org.springframework.cloud:spring-cloud-starter-config')
    compile('org.springframework.cloud:spring-cloud-starter-hystrix')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile ('org.springframework.cloud:spring-cloud-starter-hystrix-dashboard')
    compile('org.springframework.cloud:spring-cloud-starter-sleuth')
    compile('org.springframework.cloud:spring-cloud-starter-oauth2')
    compile("org.springframework.cloud:spring-cloud-starter-feign")
    }
dependencies {
    compile('org.springframework.cloud:spring-cloud-starter-oauth2:1.1.3.RELEASE')
    compile('com.nimbusds:nimbus-jose-jwt:4.33')
    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign', version: '1.3.1.RELEASE'
    compile("org.springframework.cloud:spring-cloud-starter-feign")
      } 
在一个场景中,我强制使用OAuth库中的假客户机来调用我的授权微服务,下面给出了jar的依赖文件

dependencies {
    compile('org.springframework.boot:spring-boot-starter')
    compile('org.springframework.cloud:spring-cloud-starter-eureka'){
    compile('org.springframework.cloud:spring-cloud-starter-config')
    compile('org.springframework.cloud:spring-cloud-starter-hystrix')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile ('org.springframework.cloud:spring-cloud-starter-hystrix-dashboard')
    compile('org.springframework.cloud:spring-cloud-starter-sleuth')
    compile('org.springframework.cloud:spring-cloud-starter-oauth2')
    compile("org.springframework.cloud:spring-cloud-starter-feign")
    }
dependencies {
    compile('org.springframework.cloud:spring-cloud-starter-oauth2:1.1.3.RELEASE')
    compile('com.nimbusds:nimbus-jose-jwt:4.33')
    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-feign', version: '1.3.1.RELEASE'
    compile("org.springframework.cloud:spring-cloud-starter-feign")
      } 
但是,当我使用我的服务部署新的jar文件时,在我的jar文件中实现的外部客户机不起作用,直接调用回退服务

我删除了这个假客户端,并在一个微服务中添加和测试了它,它工作正常


请帮我解决这个问题

我解决了这个问题。这是我的错。问题出在我的伪装中。修正了同样的问题。 我用“名称”代替“值”

这对我有用