iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >引入SpringCloud-gateway报错怎么解决
  • 906
分享到

引入SpringCloud-gateway报错怎么解决

2023-06-20 16:06:10 906人浏览 泡泡鱼
摘要

本篇内容介绍了“引入SpringCloud-gateway报错怎么解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!1.问题描述在我引入sp

本篇内容介绍了“引入SpringCloud-gateway报错怎么解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1.问题描述

在我引入springCloud-gateway,运行时报错如下:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'routeDefinitionRouteLocator' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'routeDefinitionRouteLocator' parameter 4; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.convert.ConversionService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="WEBFluxConversionService")}at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.DefaultSingletonBeanReGIStry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) ~[spring-boot-2.1.8.RELEASE.jar:2.1.8.RELEASE]at com.josh.joshmall.gateway.JoshmallGatewayApplication.main(JoshmallGatewayApplication.java:19) ~[classes/:na]Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.core.convert.ConversionService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="webFluxConversionService")}at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1658) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1217) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1171) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]... 19 common frames omitted

从报错的信息中我们可以看到,说没有唯一的web模块,因此会造成冲突。

因为引入了spring-cloud-starter-gateway 和 spring-boot-starter-web,两者造成了冲突

2.解决办法

只有在引入依赖的时候,去除掉一个web模块即可

 <dependency> <!--引入公共模块-->     <groupId>com.josh.joshmall</groupId>       <artifactId>joshmall-common</artifactId>       <version>0.0.1-SNAPSHOT</version>       <!--排除gateway中引入的公共模块web-->       <exclusions>      <exclusion>        <groupId>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-web</artifactId>      </exclusion>   </exclusions> </dependency>

再次运行Spirng-cloud-gateway就成功了。

SprinGCloud gateway踩坑

添加了路由规则的配置以后,SpringCloud无法正常启动,启动的时候报错

1、配置文件中开启debug=true模式

错误信息显示缺少javax.validation.ValidatorException类;

2、在pom文件中添加hibernate-validator(以及所有相关依赖)

引入SpringCloud-gateway报错怎么解决

3. 结果仍旧报错,此时错误信息:

引入SpringCloud-gateway报错怎么解决

引入SpringCloud-gateway报错怎么解决

不能为空,之前是配置在yml文件中,后来换成了properties,问题就解决了!

“引入SpringCloud-gateway报错怎么解决”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注编程网网站,小编将为大家输出更多高质量的实用文章!

--结束END--

本文标题: 引入SpringCloud-gateway报错怎么解决

本文链接: https://www.lsjlt.com/news/298191.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 引入SpringCloud-gateway报错怎么解决
    本篇内容介绍了“引入SpringCloud-gateway报错怎么解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!1.问题描述在我引入Sp...
    99+
    2023-06-20
  • 引入SpringCloud-gateway报错的解决方案
    1.问题描述 在我引入SpringCloud-gateway,运行时报错如下: org.springframework.beans.factory.UnsatisfiedDepe...
    99+
    2024-04-02
  • springboot集成springCloud中gateway时启动报错的解决
    在项目中引入springcloud中的gateway时报以下错误 Description: Parameter 0 of method modifyRequestBodyGatew...
    99+
    2024-04-02
  • springboot集成springCloud中gateway时启动报错的解决方法
    本篇内容介绍了“springboot集成springCloud中gateway时启动报错的解决方法”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所...
    99+
    2023-06-20
  • 解决springcloud 配置gateway 出现错误的问题
    降低springcloud版本,改成Hoxton.SR5就好了,再次改成Hoxton.SR12,也不报错了,很奇怪。 也发现gateway版本从2.2.6降到2.2.3了 大坑:...
    99+
    2024-04-02
  • python引入requests报错could not be resolved怎么解决
    本文小编为大家详细介绍“python引入requests报错could not be resolved怎么解决”,内容详细,步骤清晰,细节处理妥当,希望这篇“python引入requests报错could&nb...
    99+
    2023-06-30
  • react引入antd报错如何解决
    本篇内容介绍了“react引入antd报错如何解决”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!react引入antd报错的解决办法:1、通...
    99+
    2023-07-05
  • 引入jquery但报错如何解决
    这篇文章主要介绍了引入jquery但报错如何解决的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇引入jquery但报错如何解决文章都会有所收获,下面我们一起来看看吧。一、引入jQuery的方法是否正确在Web开发...
    99+
    2023-07-06
  • springcloud引入spring-cloud-starter-openfeign失败的解决
    目录引入spring-cloud-starter-openfeign失败引入下面jar包总是报错版本信息如下解决办法引入spring-cloud-starter-openfeign后...
    99+
    2024-04-02
  • SpringCloud读取Nacos配置中心报错怎么解决
    这篇文章主要介绍“SpringCloud读取Nacos配置中心报错怎么解决”,在日常操作中,相信很多人在SpringCloud读取Nacos配置中心报错怎么解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”S...
    99+
    2023-07-05
  • SpringCloud客户端报错:-wasunabletosendheartbeat!的解决
    目录微服务启动时报错问题原因解决方案SpringCloud客户端启动报错微服务启动时报错 2021-05-18 21:25:44.644 WARN 5452 — [tbe...
    99+
    2024-04-02
  • sql注入报错怎么解决
    今天小编给大家分享一下sql注入报错怎么解决的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。0x01我们先来看一看现...
    99+
    2023-07-02
  • vue引入静态jquery报错如何解决
    这篇文章主要介绍“vue引入静态jquery报错如何解决”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“vue引入静态jquery报错如何解决”文章能帮助大家解决问题。vue引入静态jquery报错的...
    99+
    2023-07-05
  • spring cloud gateway转发服务报错的解决
    目录springcloudgateway转发服务报错错误如下解决方案使用gateWay做为网关遇到的404问题GateWay有几个重要的配置,也是最重要的东西我在项目中访问gateW...
    99+
    2024-04-02
  • kibana创建索引报错怎么解决
    如果在Kibana中创建索引时遇到错误,可以尝试以下解决方法: 检查Elasticsearch连接:确保Kibana正确连接到E...
    99+
    2023-10-23
    kibana
  • nginx 504 Gateway Time-out错误怎么解决
    Nginx 504 Gateway Time-out错误通常表示服务器在代理请求到上游服务器时等待回应的时间超过了预设的时间。下面是...
    99+
    2023-08-15
    nginx
  • spring无法引入注解及importorg.springframework.web.bind.annotation.*报错的解决
    本文主要介绍了spring无法引入注解及import org.springframework.web.bind.annotation.*报错的解决,具体如下: 如图所示,sprin...
    99+
    2024-04-02
  • vue加入cdn报错怎么解决
    如果在Vue项目中加入CDN报错,可以尝试以下解决方法:1. 检查CDN链接是否正确:确保在index.html文件中引入的CDN链...
    99+
    2023-09-05
    vue cdn
  • python导入selenium报错怎么解决
    在导入selenium时,可能会遇到各种不同的错误。以下是一些常见的报错和解决方法:1. ImportError: No modul...
    99+
    2023-10-25
    python selenium
  • Vue中引入swiper报错的问题及解决
    目录首先上报错信息下载swiper6.x版本首先上报错信息 -----------更新------------------------------------------- 都是由于...
    99+
    2022-11-13
    Vue引入swiper swiper报错 Vue引入swiper报错
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作