0

得到错误

com.oracle.bmc.model.BmcException: (-1, null, false) 通信时处理异常:https://objectstorage.eu-frankfurt-1.oraclecloud.com (outbound opc-request-id: 610055D587CD432284C75AA1C52A6446)

我已从 Oracle https://docs.oracle.com/en-us/iaas/api/#/en/objectstorage/20160918/PreauthenticatedRequest/CreatePreauthenticatedRequest获取代码单元,但它不起作用

代码

        final ConfigFileReader.ConfigFile configFile = ConfigFileReader.parseDefault();
        final AuthenticationDetailsProvider provider = new ConfigFileAuthenticationDetailsProvider(configFile);

        ObjectStorageClient client = new ObjectStorageClient(provider);
        log.debug("Client Created = "+client.getEndpoint());

        /* Create a request and dependent object(s). */
        CreatePreauthenticatedRequestDetails createPreauthenticatedRequestDetails = CreatePreauthenticatedRequestDetails.builder()
                .name("EXAMPLE-name-Value")
                .bucketListingAction(PreauthenticatedRequest.BucketListingAction.ListObjects)
                .objectName("230222082346340.pdf")
                .accessType(CreatePreauthenticatedRequestDetails.AccessType.ObjectReadWrite)
                .timeExpires(new Date("Wed Nov 26 03:00:33 UTC 2042")).build();

        log.debug("createPreauthenticatedRequestDetails Created..."+createPreauthenticatedRequestDetails.getName() );

        CreatePreauthenticatedRequestRequest createPreauthenticatedRequestRequest = CreatePreauthenticatedRequestRequest.builder()
                .namespaceName("namespacename")
                .bucketName("temp")
                .createPreauthenticatedRequestDetails(createPreauthenticatedRequestDetails)
                .opcClientRequestId("ocid1.test.oc1.."+UUID.randomUUID().toString()+"-opcClientRequestId-Value")
                .build();

        CreatePreauthenticatedRequestResponse response = client.createPreauthenticatedRequest(createPreauthenticatedRequestRequest);

有什么我想念的吗?完成错误日志 09:02:25 INFO [co.or.bm.ht.ApacheConfigurator] 将连接器提供程序设置为 ApacheConnectorProvider 09:02:25 INFO [co.or.bm.ob.ObjectStorageClient] 将端点设置为https://objectstorage .eu-frankfurt-1.oraclecloud.com 09:02:25 DEBUG[or.fr.co.DocStoreOracleService]Client Created = https://objectstorage.eu-frankfurt-1.oraclecloud.com 09:02:25 DEBUG[ or.fr.co.DocStoreOracleService]createPreauthenticatedRequestDetails Created...EXAMPLE-name-Value com.oracle.bmc.model.BmcException: (-1, null, false) 通信时处理异常:https://objectstorage.eu- frankfurt-1.oraclecloud.com(出站 opc-request-id: 813E7CD051BD44FB9303B033D912F187) 在 com.oracle.bmc.http.internal.RestClient.convertToBmcException(RestClient.java:994) 在 com.oracle.bmc.http.internal.RestClient.post(RestClient.java: 306) 在 com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:89) 在 com.oracle.bmc 的 com.oracle.bmc.objectstorage.ObjectStorageClient.lambda$null$12(ObjectStorageClient.java:684)。 retrier.BmcGenericRetrier.lambda$execute$0(BmcGenericRetrier.java:60) at com.oracle.bmc.waiter.GenericWaiter.execute(GenericWaiter.java:55) at com.oracle.bmc.retrier.BmcGenericRetrier.execute(BmcGenericRetrier.java :51) 在 com.oracle.bmc.retrier.BmcGenericRetrier.doFunctionCall(BmcGenericRetrier.java:89) 在 com.oracle.bmc.retrier.com.oracle.com.oracle.bmc.objectstorage.ObjectStorageClient.lambda$createPreauthenticatedRequest$13(ObjectStorageClient.java:680)。bmc.retrier.BmcGenericRetrier.lambda$execute$0(BmcGenericRetrier.java:60) at com.oracle.bmc.waiter.GenericWaiter.execute(GenericWaiter.java:55) at com.oracle.bmc.retrier.BmcGenericRetrier.execute(BmcGenericRetrier .java:51) 在 com.oracle.bmc.objectstorage.ObjectStorageClient.createPreauthenticatedRequest(ObjectStorageClient.java:674) 在 org.freshfood.controller.DocStoreOracleService.generatePAUNew(DocStoreOracleService.java:774) 在 org.freshfood.controller.DocStoreOracleService_Subclass。 generatePAUNew$$superforward1(Unknown Source) at org.freshfood.controller.DocStoreOracleService_Subclass$$function$$8.apply(Unknown Source) at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54) at io.quarkus .arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62) 在 io.quarkus.arc.runtime。devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source) at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41) at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41) 在 io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32) 在 org.freshfood.controller.DocStoreOracleService_Subclass.generatePAUNew(Unknown Source ) 在 org.freshfood.controller.DocumentResource.getPreAuthURL(DocumentResource.java:36) 在 org.freshfood.controller.DocumentResource_Subclass.getPreAuthURL$$superforward1(Unknown Source) 在 org.freshfood.controller.DocStoreOracleService_ClientProxy.generatePAUNew(Unknown Source) 在org.freshfood.controller。DocumentResource_Subclass$$function$$4.apply(Unknown Source) at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:54) at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java: 62) 在 io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source) 在 io.quarkus.arc.impl 的 io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)。 InterceptorInvocation.invoke(InterceptorInvocation.java:41) at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:41) at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32) at org .freshfood.controller.DocumentResource_Subclass.getPreAuthURL(Unknown Source) at java.base/jdk.internal.reflect。NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 在 org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170) 在 org.jboss.resteasy.core.MethodInjectorImpl。 org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524) at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660) 调用(MethodInjectorImpl.java:130) .resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474) 在 org.jboss.resteasy.core.interception.jaxrs。PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434) at org .jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher .java:492) 在 org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261) 在 org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161) 在org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364) 在 org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247) at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service( RequestDispatcher.java:73) 在 io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:151) 在 io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:91) 在io.quarkus.vertx.core.runtime.VertxCoreRecorder$13.runWith(VertxCoreRecorder.java:543) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody .run(EnhancedQueueExecutor.java:1478) 在 org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29) 在 org.jboss.threads.ThreadLocalResettingRunnable。run(ThreadLocalResettingRunnable.java:29) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:834) 原因:javax .ws.rs.ProcessingException:RESTEASY004655:无法调用请求:javax.ws.rs.ProcessingException:RESTEASY003215:找不到内容类型应用程序/json类型的编写器:org.jboss.resteasy.client的java.lang.String .jaxrs.engines.ManualClosingApacheHttpClient43Engine.invoke(ManualClosingApacheHttpClient43Engine.java:321) at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:494) at org.jboss.resteasy.client.jaxrs.internal .ClientInvocation.invoke(ClientInvocation.java:69) 在 org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.post(ClientInvocationBuilder.java:226) 在 com.oracle.bmc.http.internal。ForwardingInvocationBuilder.post(ForwardingInvocationBuilder.java:157) 在 com.oracle.bmc.http.internal.RestClient.lambda$post$4(RestClient.java:304) 在 com.oracle.bmc.circuitbreaker.internal.JaxRsCircuitBreakerImpl.lambda$decorateSupplier $0(JaxRsCircuitBreakerImpl.java:83) at io.github.resilience4j.circuitbreaker.CircuitBreaker.lambda$decorateSupplier$4(CircuitBreaker.java:198) at com.oracle.bmc.circuitbreaker.internal.JaxRsCircuitBreakerImpl.lambda$decorateSupplier$1(JaxRsCircuitBreakerImpl. java:93) 在 com.oracle.bmc.http.internal.RestClient.post(RestClient.java:304) 的 com.oracle.bmc.http.internal.RestClient.lambda$decorateSupplier$0(RestClient.java:175) 。 .. 还有 64 个原因:javax.ws.rs.ProcessingException:RESTEASY003215:找不到内容类型应用程序/json 类型的编写器:org.jboss.resteasy.core.interception 的 java.lang.String。jaxrs.ClientWriterInterceptorContext.throwWriterNotFoundException(ClientWriterInterceptorContext.java:50) 在 org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.getWriter(AbstractWriterInterceptorContext.java:302) 在 org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext。在 org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.writeRequestBody(ClientInvocation. java:446) 在 org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine 的 org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.writeRequestBodyToOutputStream(ManualClosingApacheHttpClient43Engine.java:625)。buildEntity(ManualClosingApacheHttpClient43Engine.java:584) at org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.loadHttpMethod(ManualClosingApacheHttpClient43Engine.java:489) at org.jboss.resteasy.client.jaxrs.engines.ManualClosingApacheHttpClient43Engine.invoke(ManualClosingApacheHttpClient43Engine. java:299) ... 74 更多

4

0 回答 0