spring-cloud / spring-cloud/spring-cloud-gateway
Binding to target org.springframework.cloud.gateway.config.GatewayProperties failed
Open
Nobody has claimed this yet.
waiting-for-triage
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
I tried simple spring cloud gateway applicatinn and I'm getting this error, though I have provided the provided the configs in my application.properties.
***************************
APPLICATION FAILED TO START
***************************
Description:
Binding to target org.springframework.cloud.gateway.config.GatewayProperties failed:
Property: spring.cloud.gateway.server.webflux.routes[0].uri
Value: "null"
Reason: must not be null
Action:
Update your application's configuration
application.properties
==============
spring.cloud.discovery.enabled=true
spring.cloud.gateway.routes[0].id = hello-world
spring.cloud.gateway.routes[0].uri = http://localhost:8085/
spring.cloud.gateway.routes[0].predicates[0] = Path=/hello
### TRIED THESE PROPERTIES ALSO #####
#spring.cloud.gateway.server.webflux.routes[0].id=hello-world
#spring.cloud.gateway.server.webflux.routes[0].uri=http://localhost:8085/
#spring.cloud.gateway.server.webflux.routes[0].predicates[0]=Path=/hello
pom.xml
======
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>gateway</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
</dependency>
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-server</artifactId>
</exclusion>
</exclusions>
</dependency>-->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2025.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Main Application
============
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the startup failure with the provided application.properties and pom.xml, then inspect how the GatewayApplication loads the GatewayProperties route configuration. Done means the sample application starts successfully and the route's URI binds without the reported null-value error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100