运行 API-GATEWAY 时出现以下错误,我尝试了很多方法但无法解决此问题。
描述:
在类路径中发现 Spring MVC,与 Spring Cloud Gateway 不兼容。
行动:
请设置 spring.main.web-application-type=reactive 或删除 spring-boot-starter-web 依赖。
主班
package com.sample.apigateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class ApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
应用程序.yml
spring:
application:
name: GATEWAY-SERVICE
cloud:
gateway:
routes:
- id: USER-SERVICE
uri: lb://USER-SERVICE
predicates:
- Path=/users/**
- id: DEPARTMENT-SERVICE
uri: lb://DEPARTMENT-SERVICE
predicates:
- Path=/departments/**
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka/
instance:
hostname: localhost
server:
port: …Run Code Online (Sandbox Code Playgroud) 添加凭据时,我无法在 Jenkins 中选择凭据的范围(全局、系统),并且在不添加凭据的情况下无法继续 Jenkins 作业,请帮忙。我应该如何解决这个问题?
未显示凭证范围,请参阅屏幕截图。
Error while serving http://xxx.xxx.xxx.xxxx:xxxx/credentials/store/system/domain/_/createCredentials
java.lang.IllegalArgumentException: No enum constant com.cloudbees.plugins.credentials.CredentialsScope.
at java.base/java.lang.Enum.valueOf(Enum.java:240)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:745)
at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:490)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:799)
Caused: java.lang.IllegalArgumentException: Failed to convert the scope parameter of the constructor public com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl(com.cloudbees.plugins.credentials.CredentialsScope,java.lang.String,java.lang.String,java.lang.String,java.lang.String)
at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:801)
at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:85)
at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:690)
Caused: java.lang.IllegalArgumentException: Failed to instantiate interface com.cloudbees.plugins.credentials.Credentials
Run Code Online (Sandbox Code Playgroud)