小编San*_*tta的帖子

API 网关不起作用。抛出 java.net.UnknownHostException:无法解析

我正在使用 Spring 版本 - 2.4.5

\n

应用程序属性:

\n
spring.application.name = api-gateway\nserver.port = 8765\n#Had to put the below as I was facing No spring.config.import pro#perty has been defined and this has been put in currency exchang#e, currency converter and naming server as well\nspring.cloud.config.enabled=false \n\neureka.client.service-url.defaultZone = http://localhost:8761/eureka\n\nspring.cloud.gateway.discovery.locator.enabled=true\n\n#Tried the below two, but couldnt resolve the issue\neureka.instance.hostname=localhost\nspring.cloud.gateway.discovery.locator.lower-case-service-id=true\n
Run Code Online (Sandbox Code Playgroud)\n

所有依赖项均已正确导入。

\n

POM文件

\n
<?xml version="1.0" encoding="UTF-8"?>\n<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\n    <modelVersion>4.0.0</modelVersion>\n    <parent>\n        <groupId>org.springframework.boot</groupId>\n        <artifactId>spring-boot-starter-parent</artifactId>\n        <version>2.4.5</version>\n        <relativePath/> <!-- lookup parent from repository -->\n    </parent>\n    <groupId>com.in28minutes.microservices</groupId>\n    <artifactId>api-gateway</artifactId>\n …
Run Code Online (Sandbox Code Playgroud)

service spring spring-boot microservices api-gateway

5
推荐指数
1
解决办法
8020
查看次数