简体   繁体   English

RFC目标不存在

[英]RFC Destination does not exist

I'm trying to configure an application running in Tomcat 8.5 with Neo Cloud SDK 3.54.23 to connect to an RFC destination and run the following code: 我正在尝试使用Neo Cloud SDK 3.54.23配置在Tomcat 8.5中运行的应用程序以连接到RFC目标并运行以下代码:

String destinationName = "RFCQueryEndpoint";
ErpConfigContext erpConfigContext = new ErpConfigContext(destinationName);
ErpEndpoint endpoint = new ErpEndpoint(erpConfigContext);
response.getWriter().write(new Gson().toJson(new
             DefaultFinancialTransactionService().getList()
             .execute(endpoint).getListOfSelectedTransactions()));

I have tried multiple ways of configuring the RFC destination, but none of them worked. 我尝试了多种配置RFC目标的方法,但是没有一种有效。

I've tried setting a destinations environment variable with: 我尝试使用以下方法设置destinations环境变量:

[{name: "RFCQueryEndpoint", type: "RFC", jco.client.ashost: "host-here", jco.client.client: "100", jco.client.lang: "EN", jco.client.passwd: "pass-here", jco.client.sysnr: "01", jco.client.user: "user-here"}]

I have tried configuring the destination within the server config, as explained in https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/7fa92ffa007346f58491999361928303.html 我已经尝试在服务器配置中配置目标,如https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/7fa92ffa007346f58491999361928303.html中所述

I have tried creating a file with a .jcoDestination ending and setting the property -Djco.destinations.dir=/home/cassio/jco-destinations but none of them worked. 我尝试创建一个以.jcoDestination结尾的文件并设置属性-Djco.destinations.dir=/home/cassio/jco-destinations但是它们均-Djco.destinations.dir=/home/cassio/jco-destinations

I'm always getting: 我总是得到:

12:20:50.040 [http-nio-8080-exec-4] ERROR  - com.sap.conn.jco.JCoException: (106) JCO_ERROR_RESOURCE: Destination RFCQueryEndpoint does not exist
12:20:50.043 [http-nio-8080-exec-4] ERROR  - com.sap.conn.jco.JCoException: (106) JCO_ERROR_RESOURCE: Destination RFCQueryEndpoint does not exist
com.sap.cloud.sdk.s4hana.connectivity.rfc.exception.RemoteFunctionException: com.sap.conn.jco.JCoException: (106) JCO_ERROR_RESOURCE: Destination RFCQueryEndpoint does not exist
    at com.sap.cloud.sdk.s4hana.connectivity.rfc.JCoRemoteFunctionQueryExecutor.execute(JCoRemoteFunctionQueryExecutor.java:202)
    at com.sap.cloud.sdk.s4hana.connectivity.rfc.JCoRemoteFunctionQueryExecutor.execute(JCoRemoteFunctionQueryExecutor.java:55)
    at com.sap.cloud.sdk.s4hana.connectivity.rfc.BapiQuery.execute(BapiQuery.java:91)
    at com.sap.cloud.sdk.s4hana.datamodel.bapi.functions.DefaultFinancialTransactionGetListFunction.execute(DefaultFinancialTransactionGetListFunction.java:469)
    at MyServlet.doGet(MyServlet.java:77)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.sap.cloud.sdk.cloudplatform.servlet.RequestContextServletFilter$1.execute(RequestContextServletFilter.java:219)
    at com.sap.cloud.sdk.cloudplatform.servlet.Executable.call(Executable.java:23)
    at com.sap.cloud.sdk.cloudplatform.servlet.Executable.call(Executable.java:13)
    at com.sap.cloud.sdk.cloudplatform.servlet.RequestContextCallable.call(RequestContextCallable.java:82)
    at com.sap.cloud.sdk.cloudplatform.servlet.RequestContextServletFilter.doFilter(RequestContextServletFilter.java:221)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.sap.cloud.sdk.cloudplatform.security.servlet.HttpCachingHeaderFilter.doFilter(HttpCachingHeaderFilter.java:56)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.sap.cloud.sdk.cloudplatform.security.servlet.HttpSecurityHeadersFilter.doFilter(HttpSecurityHeadersFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.filters.RestCsrfPreventionFilter.doFilter(RestCsrfPreventionFilter.java:113)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
    at com.sap.cloud.runtime.impl.bridge.security.AbstractAuthenticator.invoke(AbstractAuthenticator.java:206)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:182)
    at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:97)
    at com.sap.js.statistics.tomcat.valve.RequestTracingValve.callNextValve(RequestTracingValve.java:101)
    at com.sap.js.statistics.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:57)
    at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

How can I properly configure an RFC destination locally, using SAP tools for Eclipse, to connect to an S/4 Hana On-Prem system using Neo Cloud SDK + Tomcat? 如何使用用于Eclipse的SAP工具在本地正确配置RFC目标,以使用Neo Cloud SDK + Tomcat连接到S / 4 Hana On-Prem系统?

I found what I believe is a workaround. 我发现我认为是一种解决方法。

If I simply set the destination on the server configuration in Eclipse, the SDK finds the destination name but can't find the configuration. 如果仅在Eclipse中的服务器配置上设置目标,则SDK会找到目标名称,但找不到配置。

I had to set the destination both in the server config page, as explained here: https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/7fa92ffa007346f58491999361928303.html 我必须在服务器配置页面中都设置目标,如此处所述: https : //help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/zh-CN/7fa92ffa007346f58491999361928303.html

And I also had to create the RFCendpoint.jcoDestination file, as follows: 而且我还必须创建RFCendpoint.jcoDestination文件,如下所示:

Name=RFCendpoint
Type=RFC
jco.client.client=100
jco.client.lang=EN
jco.client.user=User-here
jco.client.passwd=Password-here
jco.client.ashost=Host-here
jco.client.sysnr=00
jco.destination.pool_capacity=5
jco.destination.peak_limit=10

and pass the directory the file resides in via the -Djco.destinations.dir=/home/cassio/jco-destinations flag in the arguments section of my Run configuration in Eclipse. 并通过Eclipse的Run configuration的arguments部分中的-Djco.destinations.dir=/home/cassio/jco-destinations标志传递文件所在的目录。

With both of these configs I was able to get the SDK to recgonize both the endpoint name and its configuration. 通过这两个配置,我能够获得SDK来重新定义端点名称及其配置。 Then I was able to use the service as well as call other BAPIs via BapiQuery . 然后,我可以使用该服务以及通过BapiQuery调用其他BAPI。

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

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