Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

spring.cloud.gateway.discovery.locator.enabled is an unknown property. Is there any alternative. I use spring version 3.2.6

spring.application.name=api-gateway
server.port=8765

#unknown property
spring.cloud.gateway.discovery.locator.enabled=true

I tried to downgrade the version of Spring but nothing helps and I also couldn’t find an answer on the Internet

like image 755
Raul Alishov Avatar asked Oct 30 '25 10:10

Raul Alishov


2 Answers

I had the same problem as you, after some research I found that I missed a dependency.

I had in my pom the gateway-mvc, however the property was only correctly identified once I included the gateway dependency, without the "MVC":

https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-gateway

<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-gateway -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway</artifactId>
    <version>4.1.4</version>
</dependency>
like image 115
JP Navarro V. Avatar answered Nov 01 '25 01:11

JP Navarro V.


I had the same problem as you. After checking pom.xml, I found that I added the wrong dependency is:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway-mvc</artifactId>
</dependency>

Instead, try this:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
like image 30
Quân Lê Avatar answered Nov 01 '25 03:11

Quân Lê



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!