java - 访问 Azure 端点时遇到 "java.net.ConnectException: A route to the remote host is not available"

标签 java azure security websphere

我有两台服务器(模型服务器和生产服务器),代码部署在两台服务器上。只要代码在模型上,代码就可以正常工作,但一旦将其部署到生产中,我就会遇到异常。

我正在将 JDK 1.8 与版本 3.4.2okhttpokhttp-urlconnection jar 一起使用。我可以从 Java 代码中执行某些操作,以便为其提供所需的访问权限吗?你们还有别的想法吗?

我认为这可能是一些防火墙问题。

String eventGridEndpoint =String.format("https://%s/",new URI(URL).getHost());

client.publishEvents(eventGridEndpoint, eventsList); // eventList has request data sent to azure endopint.

我在访问 azure 端点时遇到的异常

"java.lang.RuntimeException: java.net.ConnectException: Failed to connect to 'URL' "
 caused by "java.net.ConnectException: A route to the remote host is not available."

最佳答案

我已经找到了问题和解决方案

没有设置前往该 IP 地址的 TCP 路由。将其添加到系统路由表中后,我们就可以连接了。

关于java - 访问 Azure 端点时遇到 "java.net.ConnectException: A route to the remote host is not available",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56754536/

相关文章:

java - 需要使用Scanner读取文件但不知道如何比较

git - 如何使用 Git Bash 将审阅者添加到 azure devops pull 请求

security - 在移动网络应用程序中混合安全和不安全的内容

java 安全客户端套接字身份验证

php - 使用 ajax 发布到 php 文件 - 安全

java - 从 Jackson 获取未知字段列表

java - 测试容器 : ignore parent `EXPOSE` instruction from Dockerfile

java - InflateException 使用滑行加载图像时发生

azure - 如何创建自定义 Docker 镜像?

Azure Web应用程序deploy.cmd消失