我正在尝试使用VDM从使用VDM的S/4HANA Cloud 1805系统读取数据,如https://blogs.sap.com/2017/05/21/step-4-with-sap-中所述s4hana-cloud-sdk-calling-an-odata-service /.目标使用基本身份验证.
示例电话:
final ErpConfigContext context = new ErpConfigContext("...");
return new DefaultQualityInspectionDataService().getAllInspectionLot().select(...).execute(context);
Run Code Online (Sandbox Code Playgroud)
这至少在S/4HANA Cloud SDK版本1.9.4之前有效.由于更新到2.0.0,由于以下异常,目标无法再使用:
2018 06 18 12:43:55#+00#ERROR#org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/app-application].[com.sap.cloud...Servlet]##anonymous#https-jsse-nio-8041-exec-3#na#a078260ed#app#web#a078260ed#na#na#na#na#Allocate exception for servlet [com.sap.cloud...Servlet] com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException: Failed to get ConnectivityConfiguration: no RequestContext available. Have you correctly configured a RequestContextFactory or have you wrapped your logic in a RequestContextExecutor when executing background tasks that are not triggered by a request?
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpNeoDestinationFacade.getConnectivityConfiguration(ScpNeoDestinationFacade.java:60)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpNeoDestinationFacade.getDestinationConfiguration(ScpNeoDestinationFacade.java:108)
at com.sap.cloud.sdk.cloudplatform.connectivity.ScpNeoDestinationFacade.getGenericDestination(ScpNeoDestinationFacade.java:183)
at com.sap.cloud.sdk.cloudplatform.connectivity.DestinationAccessor.getGenericDestination(DestinationAccessor.java:136)
at com.sap.cloud.sdk.s4hana.connectivity.ErpConfigContext.<init>(ErpConfigContext.java:218)
at com.sap.cloud.sdk.s4hana.connectivity.ErpConfigContext.<init>(ErpConfigContext.java:367)
at com.sap.cloud.sdk.s4hana.connectivity.ErpConfigContext.<init>(ErpConfigContext.java:442)
at com.sap.cloud...Servlet.<init>(...Servlet.java:31)
...
at java.lang.Thread.run(Thread.java:808) …Run Code Online (Sandbox Code Playgroud)