1

我正在尝试使用UploadObjectExample.java代码将文件上传到 OCI 对象存储。我在连接到对象存储 URL 时遇到连接超时错误。OCI CLI 使用相同的配置文件将文件成功上传到 OCI 配置。

这是错误日志:

Exception in thread "main" com.oracle.bmc.model.BmcException: (-1, null, true) Timed out while communicating to: https://objectstorage.us-ashburn-1.oraclecloud.com (outbound opc-request-id: 1EB5AA4A7FD64D58A54F876AD0C9E83B)
    at com.oracle.bmc.http.internal.RestClient.convertToBmcException(RestClient.java:572)
    at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:380)
    at com.oracle.bmc.objectstorage.ObjectStorageClient.putObject(ObjectStorageClient.java:1053)
    at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:34)
    at com.oracle.bmc.objectstorage.transfer.internal.SimpleRetry$1.apply(SimpleRetry.java:26)
    at com.oracle.bmc.objectstorage.transfer.UploadManager.singleUpload(UploadManager.java:111)
    at com.oracle.bmc.objectstorage.transfer.UploadManager.upload(UploadManager.java:73)
    at UploadObjectExample.main(UploadObjectExample.java:74)
Caused by: javax.ws.rs.ProcessingException: java.net.SocketTimeoutException: connect timed out
    at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:284)
    at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:278)
    at org.glassfish.jersey.client.JerseyInvocation.lambda$invoke$0(JerseyInvocation.java:753)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:229)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:414)
    at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:752)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:445)
    at org.glassfish.jersey.client.JerseyInvocation$Builder.put(JerseyInvocation.java:334)
    at com.oracle.bmc.http.internal.ForwardingInvocationBuilder.put(ForwardingInvocationBuilder.java:141)
    at com.oracle.bmc.http.internal.RestClient.put(RestClient.java:377)
4

4 回答 4

3

请在 Java 客户端超时的同一台机器上测试 curl -v https://objectstorage.us-ashburn-1.oraclecloud.com,以确保没有连接问题。如果它工作正常,您可以尝试更改 ClientConfiguration 中的超时值。您可以在此处查看更多详细信息:https ://github.com/oracle/oci-java-sdk/issues/92

在创建支持票之前,您还可以尝试在github/oci-java-sdk上创建一个新问题。

于 2019-03-04T09:32:37.787 回答
0

如果不知道更多关于配置文件(我不建议你在这里发布),你的家乡和其他元素,很难提供帮助。

我建议您在https://support.oracle.com打开支持票证,确保选择“云”选项卡和“服务”作为“Oracle 云基础设施”。

于 2019-03-04T09:24:56.520 回答
0

您是否使用了代理?如果是这样,您可能需要使用 OCI Java SDK ApacheConnector

于 2019-03-04T17:55:49.263 回答
0

这是代理的问题。这已通过使用 ash7 代理解决。

于 2019-03-15T12:29:29.957 回答