简体   繁体   English

com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException

[英]com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException

Hello I've followed so far the tutorial https://developers.sap.com/tutorials/s4sdk-odata-service-cloud-foundry.html step by step and I'm having issues, to run the solution on local machine.您好,到目前为止,我已经按照教程https://developers.sap.com/tutorials/s4sdk-odata-service-cloud-foundry.html一步一步地进行操作,但我遇到了问题,无法在本地计算机上运行解决方案。

I'm running windows 10 and according to tutorial I have set an environment variable to be as following: destinations=[{name: "ErpQueryEndpoint", url: "xxxx.s4hana.ondemand.com", username: "INT_USER", password: "xxxxxxxx"}]我正在运行 Windows 10,根据教程,我将环境变量设置为如下: destinations=[{name: "ErpQueryEndpoint", url: "xxxx.s4hana.ondemand.com", username: "INT_USER", password: "xxxxxxxx"}]

when i run the solution on localhost i get this:当我在本地主机上运行解决方案时,我得到了这个:

Message Error occured while handling request: com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to get destinations of provider service instance: Failed to get access token for destination service.处理请求时发生消息错误:com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException:com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException:无法获取提供者服务实例的目的地:无法获取目标服务的访问令牌。 If your application is running on Cloud Foundry, make sure to have a binding to both the destination service and the authorization and trust management (xsuaa) service, AND that you either properly secured your application or have set the "ALLOW_MOCKED_AUTH_HEADER" environment variable to true.如果您的应用程序在 Cloud Foundry 上运行,请确保绑定到目标服务和授权和信任管理 (xsuaa) 服务,并且您已正确保护您的应用程序或已将“ALLOW_MOCKED_AUTH_HEADER”环境变量设置为 true . Please note that authentication types with user propagation, for example, principal propagation or the OAuth2 SAML Bearer flow, require that you secure your application and will not work when using the "ALLOW_MOCKED_AUTH_HEADER" environment variable.请注意,具有用户传播的身份验证类型,例如主体传播或 OAuth2 SAML 承载流,要求您保护应用程序,并且在使用“ALLOW_MOCKED_AUTH_HEADER”环境变量时将不起作用。 If your application is not running on Cloud Foundry, for example, when deploying to a local container, consider declaring the "destinations" environment variable to configure destinations.如果您的应用程序未在 Cloud Foundry 上运行,例如,在部署到本地容器时,请考虑声明“destinations”环境变量以配置目的地。

Be sure to set the destinations variable so it is visible to your application.请务必设置destinations变量,以便它对您的应用程序可见。 You can check using System.getenv("destinations");您可以使用System.getenv("destinations");检查System.getenv("destinations"); in your code.在你的代码中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM