![]() |
Nuñito Calzada · Spring Boot with ...· 6 月前 |
|
Kallydi · jdbc无法连接到docker中的postg ...· 6 月前 |
![]() |
PatPanda · 使用springboot验证请求中的列表是否 ...· 6 月前 |
![]() |
Dónal · Spring ...· 6 月前 |
我想使用SAP CloudSDK 3.20.0向本地SAP ABAP系统发送自定义OData请求。“自定义”意味着我不能使用虚拟数据模型,而是“手动”组装请求URL,并像处理常规REST请求一样自行处理响应。
我的应用程序使用Java和Spring Boot运行。预期的请求需要一段时间才能完成,因此是从异步线程发送的。
我已经设置了一个云连接器,可以证明代码和配置在几个都使用基本身份验证的目的地上运行良好。现在,首次尝试使用主体传播时,代码在尝试获取HTTP客户端时失败,出现异常:
try {
Destination destination = DestinationAccessor.getDestination(destinationName);
HttpDestination httpDestination = destination.asHttp().decorate(DefaultErpHttpDestination::new);
// this fails:
HttpClient httpClient = HttpClientAccessor.getHttpClient(httpDestination);
// ...
} catch (Exception exception) {
// receives
// DestinationAccessException: "Failed to get on-premise proxy headers."
// PrincipalAccessException: "Could not read a principal from neither
// a given JWT nor a given Basic Authentication header."
// full stack trace below
}
我的假设是,我正在运行的异步线程出了问题,我没有完全或以正确的方式传递上下文,以便CloudSDK传播主体。
有一件事我
是
做的是我用的
AuthTokenAccessor.getCurrentToken()
在原始线程中检索安全令牌,以及
AuthTokenAccessor.executeWithAuthToken(authToken, command::run)
将令牌传播到从那里异步启动的线程。
不幸的是,使用CloudSDK的异步线程是一个相当空白的空间,我找不到任何说明这里到底需要什么的文档或教程。
com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to get on-premise proxy headers.
at com.sap.cloud.sdk.cloudplatform.connectivity.ConnectivityService.getHeadersForOnPremiseSystem(ConnectivityService.java:62)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestinationPropertyFactory.getOnPremiseProxyHeaders(ScpCfHttpDestinationPropertyFactory.java:673)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestinationPropertyFactory.getHeadersFromDestination(ScpCfHttpDestinationPropertyFactory.java:591)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestination.<init>(ScpCfHttpDestination.java:173)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfHttpDestination.<init>(ScpCfHttpDestination.java:79)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpCfDestination.asHttp(ScpCfDestination.java:49)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientFactory.getHttpDestination(DefaultHttpClientFactory.java:56)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientFactory.getHttpDestinationProperties(DefaultHttpClientFactory.java:44)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientFactory.getHttpClient(DefaultHttpClientFactory.java:32)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientFactory$$FastClassBySpringCGLIB$$87b87cd0.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientFactory$$EnhancerBySpringCGLIB$$8d195096.getHttpClient(<generated>)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientRetryExecutor.getHttpClient(DefaultHttpClientRetryExecutor.java:57)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientRetryExecutor.executeAndGetResponse(DefaultHttpClientRetryExecutor.java:49)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientRetryExecutor.executeWithRetry(DefaultHttpClientRetryExecutor.java:38)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientRetryExecutor$$FastClassBySpringCGLIB$$aa3836e1.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:91)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:164)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:118)
at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:153)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultHttpClientRetryExecutor$$EnhancerBySpringCGLIB$$4196dda3.executeWithRetry(<generated>)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultRequestExecutor.executeGetRequestAndReturnHttpResponse(DefaultRequestExecutor.java:66)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultRequestExecutor.executeGetRequest(DefaultRequestExecutor.java:48)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultRequestExecutor$$FastClassBySpringCGLIB$$209b987b.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.api.odataadapter.common.http.DefaultRequestExecutor$$EnhancerBySpringCGLIB$$fdefc677.executeGetRequest(<generated>)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.DefaultOdataResultMetadataReader.readMetadata(DefaultOdataResultMetadataReader.java:32)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.DefaultOdataResultMetadataReader$$FastClassBySpringCGLIB$$7f270a2b.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.DefaultOdataResultMetadataReader$$EnhancerBySpringCGLIB$$2aaea987.readMetadata(<generated>)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.OdataResultMetadataAdapter.enrichMetadata(OdataResultMetadataAdapter.java:53)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.OdataResultMetadataAdapter$$FastClassBySpringCGLIB$$7e0d7c0e.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.api.odataadapter.metadataadapters.OdataResultMetadataAdapter$$EnhancerBySpringCGLIB$$b15ac510.enrichMetadata(<generated>)
at com.sap.grc.automatedprocedures.businesslogic.core.automatedprocedure.AutomatedProcedureMetadataRequestorTransaction.requestAndSaveMetadata(AutomatedProcedureMetadataRequestorTransaction.java:62)
at com.sap.grc.automatedprocedures.businesslogic.core.automatedprocedure.AutomatedProcedureMetadataRequestorTransaction$$FastClassBySpringCGLIB$$319e3277.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
at com.sap.grc.automatedprocedures.businesslogic.core.automatedprocedure.AutomatedProcedureMetadataRequestorTransaction$$EnhancerBySpringCGLIB$$d02aa2a4.requestAndSaveMetadata(<generated>)
at com.sap.grc.automatedprocedures.businesslogic.core.automatedprocedure.DefaultAutomatedProcedureMetadataRequestor.requestAndSaveMetadata(DefaultAutomatedProcedureMetadataRequestor.java:35)
at com.sap.grc.automatedprocedures.businesslogic.core.automatedprocedure.DefaultAutomatedProcedureMetadataRequestor$$FastClassBySpringCGLIB$$7ff09138.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.sap.cloud.sdk.cloudplatform.security.AuthTokenAccessor.lambda$executeWithAuthToken$3(AuthTokenAccessor.java:206)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:247)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:293)
at com.sap.cloud.sdk.cloudplatform.security.AuthTokenAccessor.executeWithAuthToken(AuthTokenAccessor.java:188)
at com.sap.cloud.sdk.cloudplatform.security.AuthTokenAccessor.executeWithAuthToken(AuthTokenAccessor.java:205)
at com.sap.grc.automatedprocedures.configuration.asynchronouslythreads.RequestContextExecutorConfiguration$WrappedExecutor.lambda$execute$0(RequestContextExecutorConfiguration.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:836)
Caused by: com.sap.cloud.sdk.cloudplatform.resilience.ResilienceRuntimeException: com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException: com.sap.cloud.sdk.cloudplatform.security.exception.TokenRequestFailedException: Failed to determine cache key.
at com.sap.cloud.sdk.frameworks.resilience4j.Resilience4jDecorationStrategy.lambda$null$2(Resilience4jDecorationStrategy.java:181)
at io.vavr.control.Try.onFailure(Try.java:659)
at com.sap.cloud.sdk.frameworks.resilience4j.Resilience4jDecorationStrategy.lambda$decorateCallable$3(Resilience4jDecorationStrategy.java:180)
at com.sap.cloud.sdk.cloudplatform.resilience.ResilienceDecorationStrategy.executeCallable(ResilienceDecorationStrategy.java:210)
at com.sap.cloud.sdk.cloudplatform.resilience.ResilienceDecorator.executeCallable(ResilienceDecorator.java:197)
at com.sap.cloud.sdk.cloudplatform.connectivity.ConnectivityService.getHeadersForOnPremiseSystem(ConnectivityService.java:50)
... 130 more
Caused by: com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException: com.sap.cloud.sdk.cloudplatform.security.exception.TokenRequestFailedException: Failed to determine cache key.
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:299)
at com.sap.cloud.sdk.frameworks.resilience4j.DefaultThreadContextProvider.lambda$decorateCallable$0(DefaultThreadContextProvider.java:26)
... 4 more
Caused by: com.sap.cloud.sdk.cloudplatform.security.exception.TokenRequestFailedException: Failed to determine cache key.
at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.lambda$getUserTokenCacheKey$1(XsuaaService.java:106)
at io.vavr.control.Try.getOrElseThrow(Try.java:748)
at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.getUserTokenCacheKey(XsuaaService.java:106)
at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.retrieveAccessTokenViaUserTokenGrant(XsuaaService.java:300)
at com.sap.cloud.sdk.cloudplatform.connectivity.PrincipalPropagationStrategy.getHeadersWithRecommendedStrategy(PrincipalPropagationStrategy.java:202)
at com.sap.cloud.sdk.cloudplatform.connectivity.ConnectivityService.lambda$getHeadersForOnPremiseSystem$0(ConnectivityService.java:51)
at com.sap.cloud.sdk.frameworks.resilience4j.Resilience4jDecorationStrategy.lambda$decorateCallable$1(Resilience4jDecorationStrategy.java:160)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:247)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:293)
... 5 more
Caused by: com.sap.cloud.sdk.cloudplatform.security.principal.exception.PrincipalAccessException: Could not read a principal from neither a given JWT nor a given Basic Authentication header.
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.createFallbackException(ScpCfPrincipalFacade.java:92)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:87)
at io.vavr.control.Try.flatMapTry(Try.java:490)
at io.vavr.control.Try.flatMap(Try.java:472)
at com.sap.cloud.sdk.cloudplatform.security.principal.PrincipalAccessor.tryGetCurrentPrincipal(PrincipalAccessor.java:112)
at com.sap.cloud.sdk.cloudplatform.security.principal.PrincipalAccessor.getCurrentPrincipal(PrincipalAccessor.java:95)
at com.sap.cloud.sdk.cloudplatform.cache.CacheKey.ofTenantAndPrincipalIsolation(CacheKey.java:184)
at io.vavr.control.Try.of(Try.java:75)
at com.sap.cloud.sdk.cloudplatform.connectivity.XsuaaService.getUserTokenCacheKey(XsuaaService.java:105)
... 11 more
Suppressed: com.sap.cloud.sdk.cloudplatform.security.principal.exception.PrincipalAccessException: Could not read a principal from neither a given JWT nor a given Basic Authentication header.
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.createFallbackException(ScpCfPrincipalFacade.java:92)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:87)
at io.vavr.control.Try.flatMapTry(Try.java:490)
at io.vavr.control.Try.flatMap(Try.java:472)
at com.sap.cloud.sdk.cloudplatform.security.principal.PrincipalAccessor.tryGetCurrentPrincipal(PrincipalAccessor.java:112)
at com.sap.cloud.sdk.cloudplatform.security.principal.PrincipalThreadContextListener.afterInitialize(PrincipalThreadContextListener.java:79)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.notifyAfterInitialize(ThreadContextCallable.java:144)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:245)
at com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:293)
at com.sap.cloud.sdk.cloudplatform.security.AuthTokenAccessor.executeWithAuthToken(AuthTokenAccessor.java:188)
at com.sap.cloud.sdk.cloudplatform.security.AuthTokenAccessor.executeWithAuthToken(AuthTokenAccessor.java:205)
at com.sap.grc.automatedprocedures.configuration.asynchronouslythreads.RequestContextExecutorConfiguration$WrappedExecutor.lambda$execute$0(RequestContextExecutorConfiguration.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
... 4 more
Suppressed: com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextPropertyException: Property 'com.sap.cloud.sdk.cloudplatform.security.principal.PrincipalThreadContextListener:principal' does not exist.
at com.sap.cloud.sdk.cloudplatform.thread.DefaultThreadContext.getProperty(DefaultThreadContext.java:45)
at com.sap.cloud.sdk.cloudplatform.security.principal.DefaultPrincipalFacade.lambda$tryGetCurrentPrincipal$0(DefaultPrincipalFacade.java:28)
at io.vavr.control.Try.flatMapTry(Try.java:490)
at io.vavr.control.Try.flatMap(Try.java:472)
at com.sap.cloud.sdk.cloudplatform.security.principal.DefaultPrincipalFacade.tryGetCurrentPrincipal(DefaultPrincipalFacade.java:28)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:81)
... 15 more
Suppressed: com.sap.cloud.sdk.cloudplatform.security.principal.exception.PrincipalAccessException: There is no reader registered for grant type 'urn:ietf:params:oauth:grant-type:jwt-bearer'.
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.lambda$getPrincipalId$c8b7f4af$1(AuthTokenPrincipalExtractor.java:97)
at io.vavr.control.Try.of(Try.java:75)
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.getPrincipalId(AuthTokenPrincipalExtractor.java:75)
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.tryGetCurrentPrincipal(AuthTokenPrincipalExtractor.java:199)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:83)
... 15 more
Suppressed: com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextPropertyException: Property 'com.sap.cloud.sdk.cloudplatform.servlet.RequestThreadContextListener:request' does not exist.
at com.sap.cloud.sdk.cloudplatform.thread.DefaultThreadContext.getProperty(DefaultThreadContext.java:45)
at com.sap.cloud.sdk.cloudplatform.servlet.DefaultRequestFacade.lambda$tryGetCurrentRequest$0(DefaultRequestFacade.java:29)
at io.vavr.control.Try.flatMapTry(Try.java:490)
at io.vavr.control.Try.flatMap(Try.java:472)
at com.sap.cloud.sdk.cloudplatform.servlet.DefaultRequestFacade.tryGetCurrentRequest(DefaultRequestFacade.java:29)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessor.tryGetCurrentRequest(RequestAccessor.java:87)
at com.sap.cloud.sdk.cloudplatform.security.DefaultBasicAuthenticationFacade.extractBasicCredentialsFromRequest(DefaultBasicAuthenticationFacade.java:72)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.DefaultBasicAuthenticationFacade.tryGetBasicCredentials(DefaultBasicAuthenticationFacade.java:55)
at com.sap.cloud.sdk.cloudplatform.security.BasicAuthenticationAccessor.tryGetCurrentBasicCredentials(BasicAuthenticationAccessor.java:57)
at com.sap.cloud.sdk.cloudplatform.security.principal.BasicCredentialsPrincipalExtractor.tryGetCurrentPrincipal(BasicCredentialsPrincipalExtractor.java:20)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:85)
... 15 more
Suppressed: com.sap.cloud.sdk.cloudplatform.security.principal.exception.PrincipalAccessException: There is no reader registered for grant type 'urn:ietf:params:oauth:grant-type:jwt-bearer'.
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.lambda$getPrincipalId$c8b7f4af$1(AuthTokenPrincipalExtractor.java:97)
at io.vavr.control.Try.of(Try.java:75)
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.getPrincipalId(AuthTokenPrincipalExtractor.java:75)
at com.sap.cloud.sdk.cloudplatform.security.principal.AuthTokenPrincipalExtractor.tryGetCurrentPrincipal(AuthTokenPrincipalExtractor.java:199)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:83)
... 18 more
Suppressed: com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextPropertyException: Property 'com.sap.cloud.sdk.cloudplatform.servlet.RequestThreadContextListener:request' does not exist.
at com.sap.cloud.sdk.cloudplatform.thread.DefaultThreadContext.getProperty(DefaultThreadContext.java:45)
at com.sap.cloud.sdk.cloudplatform.servlet.DefaultRequestFacade.lambda$tryGetCurrentRequest$0(DefaultRequestFacade.java:29)
at io.vavr.control.Try.flatMapTry(Try.java:490)
at io.vavr.control.Try.flatMap(Try.java:472)
at com.sap.cloud.sdk.cloudplatform.servlet.DefaultRequestFacade.tryGetCurrentRequest(DefaultRequestFacade.java:29)
at com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessor.tryGetCurrentRequest(RequestAccessor.java:87)
at com.sap.cloud.sdk.cloudplatform.security.DefaultBasicAuthenticationFacade.extractBasicCredentialsFromRequest(DefaultBasicAuthenticationFacade.java:72)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.DefaultBasicAuthenticationFacade.tryGetBasicCredentials(DefaultBasicAuthenticationFacade.java:55)
at com.sap.cloud.sdk.cloudplatform.security.BasicAuthenticationAccessor.tryGetCurrentBasicCredentials(BasicAuthenticationAccessor.java:57)
at com.sap.cloud.sdk.cloudplatform.security.principal.BasicCredentialsPrincipalExtractor.tryGetCurrentPrincipal(BasicCredentialsPrincipalExtractor.java:20)
at io.vavr.control.Try.orElse(Try.java:726)
at com.sap.cloud.sdk.cloudplatform.security.principal.ScpCfPrincipalFacade.tryGetCurrentPrincipal(ScpCfPrincipalFacade.java:85)
... 18 more
![]() |
1
1
关于你的子问题 如何异步运行操作 使用Cloud SDK:即 documented here . AFAI可以看到你做得对。如果您不确定确切需要哪些信息,或者如果您想避免从授权令牌中多次提取信息,可以考虑传递完整的线程上下文。 如果您发现文档缺少基本信息,或者对如何增强文档有想法,我建议您提出 issue 或打开a pull request 上 public GitHub . |
![]() |
2
0
更新:
此身份验证类型为
supported as of Cloud SDK
初步答复:
从示例性的异常堆栈跟踪中,我注意到了授权类型
你能告诉我们,你正在研究哪个SCP环境吗?我们有办法复制您的设置吗?您从哪里获得访问令牌?你在用 批准 ? 作为一种潜在的解决方法,在调查和修复完成之前,您可以尝试以下方法:
|