zuul转发异常

zuul转发异常

问题描述:

一直都是报这个500的转发异常,老师等一分钟就好了,我等了十分钟了都还是报这个异常,没有检查出哪里有问题

相关截图:

http://img1.sycdn.imooc.com//climg/605a93f80944d6a110470599.jpg


http://img1.sycdn.imooc.com//climg/605a931509fc967717970379.jpg

http://img1.sycdn.imooc.com//climg/605a96fa091b1eaa18490768.jpg

相关代码:

spring.application.name=mall-cloud-zuul
server.port=8082

spring.datasource.name=imooc_mall_datasource
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/imooc_mall?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=123456

mybatis.mapper-locations=classpath:mappers/*.xml

logging.pattern.console=%date %level [%thread] %logger{10} [%file:%line] - %msg%n

# 客户端与Eureka服务端进行交互的地址
eureka.client.service-url.defaultZone=http://localhost:8000/eureka

zuul.prefix=/
zuul.routes.mall-cloud-user.path=/user/**
zuul.routes.mall-cloud-user.service-id=mall-cloud-user

相关代码:

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.openfeign.EnableFeignClients;

@EnableZuulProxy
@EnableFeignClients
@SpringCloudApplication
public class ZuulGatewayApplication {

public static void main(String[] args) {
SpringApplication.run(ZuulGatewayApplication.class,args);
}
}

相关代码:

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mall_cloud</artifactId>
<groupId>com.imooc</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>mall-cloud-zuul</artifactId>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
<version>2.2.4.RELEASE</version>
</dependency>

<dependency>
<groupId>com.imooc</groupId>
<artifactId>mall-cloud-user</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小班 2021-03-24 14:48:36

同学你好,1、查看同学的报错信息,有如下创建断点的提示,同学是否在项目中执行了断点操作,同学可以检查一下自己的项目。

http://img1.sycdn.imooc.com//climg/605ae00a09d0b8f208980167.jpg

    ​2、同学可以检查一下是否有其他报错信息呐,如果有,可以贴出来,便于老师根据报错定位问题。

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师