Problem Description:
When I use spring cloud to integrate zuul, the project can run, but when I access through the route, I will be prompted with HTTP status 500 – internal server error error
Causes:
The springboot version is inconsistent with the spring cloud starter Netflix zuul version
before modification, my configuration is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.cloud</groupId>
<artifactId>api-gateway-dynamic-route</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api-gateway-dynamic-route</name>
<description>api-gateway-dynamic-route</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-zuul -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
</dependencies>
</project>
Solution
Change the version of springboot to 2.4.8
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.8</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.cloud</groupId>
<artifactId>api-gateway-dynamic-route</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>api-gateway-dynamic-route</name>
<description>api-gateway-dynamic-route</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-zuul -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.9.RELEASE</version>
</dependency>
</dependencies>
</project>
So far, the problem caused by the version has been solved
Read More:
- [Solved] Error in registering Eureka for spring cloud micro service: classnotfoundexception: org.apache.http.conn.scheme.schemeregistry
- Using openfeign to remotely call the startup program to report an error
- Eureka failed to register error: saw local status change event statuschangeevent
- HTTP status 500 – internal server error (resolved) for Tomcat running project
- Saw local status change event statuschangeevent error during springcloud client registration
- Solve the problem of There was an unexpected error (type=Internal Server Error, status=500) (using Thymeleaf to report an error)
- Error parsing lifecycle processing instructions
- Integration openfeign failed to start
- com.netflix.zuul.exception.ZuulException: Forwarding error
- Zuul gateway routing URL and service ID configuration
- Springboot startup error [extshutdown hook]
- Springboot startup error: java.lang.IllegalArgumentException : Property ‘sqlSessionFactory’ or ‘sqlSessionTempla
- gateway Internal Server Error 500 Invalid host: lb://xxxxxx
- HTTPError HTTP Error 500 INTERNAL SERVER ERROR
- Unable to access javax.servlet.servletexception [How to Solve]
- Building Eureka_ Server error: application failed to start with classpath:file :/C:/ProgramFiles/Java/jdk
- HTTP 405 Error: Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
- Springboot startup error could not resolve placeholder XXX
- Nginx 502 Error: Failed to load resource: the server responded with a status of 502 (Bad Gateway)
- asp.net HTTP error 500.24 – internal server error