首页 > 编程语言 >使用网关Zuul的时候,报java.lang.NoSuchMethodError: org.springframework.boot.web.servlet.error.ErrorController

使用网关Zuul的时候,报java.lang.NoSuchMethodError: org.springframework.boot.web.servlet.error.ErrorController

时间:2022-08-13 19:13:45浏览次数:62  
标签:lang web 网关 Zuul spring boot springframework org cloud

最近遇到一个困扰了我很久的问题(关于Zuul):

报错界面如下:

 

 原因是因为:Zuul与SpringBoot版本冲突,而SpringCloud又和SpringBoot版本关联,

SpringCloud与SpringBoot版本可以参考如下:

            <dependency>
<!--            导入springCloud的依赖-->
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Hoxton.SR12</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
<!--            SpringBoot-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.3.4.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>    

zuul以及eureka参看如下:

     <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.2.5.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            <version>2.2.5.RELEASE</version>
        </dependency>

配置好相应的Zuul测试环境,重新测试即可成功.

标签:lang,web,网关,Zuul,spring,boot,springframework,org,cloud
From: https://www.cnblogs.com/lhr123/p/16583820.html

相关文章

  • WebStrom开发微信小程序,基本配置
    WebStrom开发微信小程序,基本配置注意默认情况下,webstorm不支持wxml和wxss的文件类型,所以需要手动去配置。我们只需要配置.wxml和.wxss:识别为:.wxml->html.wxss->css......
  • webpack使用
    Node.js遵循CommonJs规范,核心思想允许require方法来同步加载所需依赖的其他模块,通过exports或者module.exports来导出需要暴露的接口 优点:服务端模块便于复用缺点:同步......
  • Power App Portal WebApi使用
    官方文档:webapi-tutorial 1、创建SiteSettings 添加要使用表的sitesettings两条格式为:Webapi/[表名]/enabled:启用此表Webapi/[表名]/fields:要查找的字段如......
  • IfcLanguageId
    IfcLanguageId类型定义IfcLanguageId标识自然语言文本的表达语言。它使用语言标记来标识语言。 注:标签应符合RFC5646中表达的互联网工程任务组(IETF)语言标签。一致性......