1. Error message
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)} 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:1662) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1221) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.10.RELEASE.jar:5.1.10.RELEASE] ... 19 common frames omitted
2. Reason
At the same time introduce dependencies: spring-cloud-starter-gateway and spring-boot-starter-web
The web module has been referenced in the gateway, so it will cause conflicts. I actually noticed this when I was learning about the gateway, but I still reported an error.
The pom.xml file is as follows
<dependencies> <dependency> <groupId>com.fdzang.microservice</groupId> <artifactId>api-common</artifactId> <version>1.0-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> <version>${spring.cloud.starter.version}</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <version>${spring.cloud.starter.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <version>${spring.boot.version}</version> <optional>true</optional> </dependency> </dependencies>
I did not rely on the web module in my pom, and I still reported an error, so I tried to exclude the web from the gateway, but to no avail.
After various attempts, I found that the web module was referenced in the common module I cited, and the case was solved.
So remove
<dependency> <groupId>com.fdzang.microservice</groupId> <artifactId>api-common</artifactId> <version>1.0-SNAPSHOT</version> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </exclusion> </exclusions> </dependency>
It runs successfully.
Read More:
- [Solved] Springcloud Add gateway to Startup Error: Exception encountered during context initialization – cancelling refresh
- Gateway Error: Cannot resolve org.springframework.cloud:spring-cloud-starter-gateway:unknown
- Springcloud configuration center client 3355 startup Error: error on get request for“ http://localhost:8761/eureka/apps/ “: Connection
- [Solved] The version of springcloud must support the current version of springboot, otherwise the startup project will report an error: error starting ApplicationContext
- [Solved] gateway Error: reactor.core.Exceptions$ErrorCallbackNotImplemented
- [Solved] Springcloud config Error: Error occured cloning to base directory.
- [Solved] JMETER pressure measure with a lot of Ports Error: 504GATEWAY TIMEOUT
- [Solved] Mycat Startup Error: ERROR Startup failed: Timed out waiting for a signal from the JVM
- SpringBoot startup error Failed to determine a suitable driver class
- How to Fix Error when integrating spring cloud openfeign with spring cloud Alibaba
- [Solved] renren-fast Startup Error: Error creating bean with name ‘scheduleJobController‘
- [Solved] kafka Startup Error: Fatal error during KafkaServer startup
- [Solved] JIRA startup error: JIRA startup failed, JIRA has been locked.
- Dyf Spring boot startup error: NoSuchBeanDefinitionException
- NPM run dev Error Module build failed: Error: Cannot find module ‘node-sass’
- Tomcat startup error: java.lang.NoClassDefFoundError
- [Solved] Swagger Startup Error: Failed to start bean ‘documentationPluginsBootstrapper‘
- [How to Fix] Spring boot startup error: could not resolve placeholder
- [Solved] nacos Startup Error: Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
- IDEA appears Module ** must not contain source root **. The root already belongs to module ** This kind of error solution