我有两台服务器(模型服务器和生产服务器),代码部署在两台服务器上。只要代码在模型上,代码就可以正常工作,但一旦将其部署到生产中,我就会遇到异常。
我正在将 JDK 1.8
与版本 3.4.2
的 okhttp
和 okhttp-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/