Creating ErpConfigContext threw exception

前端 未结 1 1594
北海茫月
北海茫月 2021-01-19 07:11

I am trying to use the S/4HANA SDK to call the CompanyCode OData VDM service but if I do this in the Cloud Foundry environment I\'m getting the attached error. I have been u

相关标签:
1条回答
  • 2021-01-19 07:38

    Can you try to make sure that the RequestContextServletFilter is picked up in your application? The RequestContextServletFilter uses the @WebFilter annotation by default.

    Example for Spring Boot:

    @SpringBootApplication
    @ServletComponentScan( "com.sap.cloud.sdk" )
    public class Application extends SpringBootServletInitializer
    {
        ...
    }
    

    See also: https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/web/servlet/ServletComponentScan.html

    EDIT: Note that when running your code in a background job (not triggered by a request), you have to wrap your code with RequestContextExecutor::execute.

    0 讨论(0)
提交回复
热议问题