Closed gregorwolf closed 8 months ago
Hi Gregor, I think the issue might be that that your destination is
Instead, try:
export destinations='[{"name": "SAP_ABAP_BACKEND_RFC", "type": "RFC"}]'
If this doesn't fix it please double check you are attaching the full stack trace. The above one seems to be cut off, it doesn't include the actual cause of DestinationAccessException
.
Finally, please note though that the RFC functionality is deprecated and may be removed in future versions.
Hi @MatKuhr,
thank you for the tip to add the type. This should be quickly corrected in Set Destination as Environment Variable. I run now into the next error:
com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException: jakarta.servlet.ServletException: Handler dispatch failed: java.lang.NoClassDefFoundError: com/sap/conn/jco/JCoException
maybe you also have a tip here. Where does the command:
mvn install:install-file -Dfile=sapjco3.jar -DgroupId=com.sap.conn.jco -DartifactId=com.sap.conn.jco.sapjco3 -Dversion=3.1.9 -Dpackaging=jar
be run in?
corrected in Set Destination as Environment Variable.
Thanks, fixed with this PR 😉
Where does the command
I don't quite get the question.. In any terminal where you would run any command basically?
In the end you need to have the JAR file locally on your file system and install in into the .m2/repository
directory where Maven stores your dependencies locally. How that exactly works on BAS I'm not sure, but I'd think it works equally as on your local machine..
Hi @MatKuhr ,
we're making progress. I've checked my local .m2/repository/
folder and found:
➜ ~ ls -la .m2/repository/com/sap/conn/jco/com.sap.conn.jco.sapjco3/3.1.9
total 3160
drwxr-xr-x 5 gwolf staff 160 Mar 29 11:23 .
drwxr-xr-x 5 gwolf staff 160 Mar 28 17:08 ..
-rw-r--r-- 1 gwolf staff 215 Apr 2 13:56 _remote.repositories
-rw-r--r-- 1 gwolf staff 1607913 Mar 19 18:34 com.sap.conn.jco.sapjco3-3.1.9.jar
-rw-r--r-- 1 gwolf staff 485 Mar 28 17:08 com.sap.conn.jco.sapjco3-3.1.9.pom
I've updated my sample repository sap-cloud-sdk-rfc for my local environment and enabled the JCo. But now I get this exception:
Unexpected servlet filter exception: jakarta.servlet.ServletException: Handler dispatch failed: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path: /Users/gwolf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException: jakarta.servlet.ServletException: Handler dispatch failed: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path: /Users/gwolf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextExecutor.execute(ThreadContextExecutor.java:272)
at com.sap.cloud.sdk.cloudplatform.servletjakarta.RequestAccessorFilter.doFilter(RequestAccessorFilter.java:60)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: jakarta.servlet.ServletException: Handler dispatch failed: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path: /Users/gwolf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1104)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
at com.sap.cloud.sdk.cloudplatform.servletjakarta.RequestAccessorFilter.lambda$doFilter$0(RequestAccessorFilter.java:60)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextExecutor.lambda$execute$1(ThreadContextExecutor.java:264)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextExecutor.call(ThreadContextExecutor.java:297)
at com.sap.cloud.sdk.cloudplatform.thread.ThreadContextExecutor.execute(ThreadContextExecutor.java:263)
... 31 common frames omitted
Caused by: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path: /Users/gwolf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
at com.sap.conn.jco.rt.Middleware.<clinit>(Middleware.java:89)
at com.sap.conn.jco.rt.JCoRuntime.setMiddlewarePropertyValue(JCoRuntime.java:1765)
at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:88)
at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:421)
at java.base/java.lang.Class.forName(Class.java:412)
at com.sap.conn.jco.JCo.createJCo(JCo.java:37)
at com.sap.conn.jco.JCo.<clinit>(JCo.java:28)
at com.sap.conn.jco.JCoDestinationManager.getDestination(JCoDestinationManager.java:56)
at com.sap.cloud.sdk.s4hana.connectivity.rfc.JCoTransaction.<init>(JCoTransaction.java:96)
at com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmTransactionFactory.createJCoTransaction(RfmTransactionFactory.java:34)
at com.sap.cloud.sdk.s4hana.connectivity.rfc.AbstractTransactionFactory.createTransaction(AbstractTransactionFactory.java:38)
at com.sap.cloud.sdk.s4hana.connectivity.rfc.RemoteFunctionRequestExecutor.execute(RemoteFunctionRequestExecutor.java:42)
at com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmRequest.execute(RfmRequest.java:85)
at rfctest.controllers.RfcController.getHello(RfcController.java:40)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:254)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:182)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:917)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:829)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
... 46 common frames omitted
It seems to me that the DYLD_LIBRARY_PATH variable that I've configured:
➜ application git:(main) ✗ echo $DYLD_LIBRARY_PATH
/Users/gwolf/Downloads/sapjco3-darwinintel64-3.1.9
isn't picked up correctly.
Okay, that seems to be an error thrown by JCo itself. I don't know what the exact instructions for your OS are, maybe the setup has changed since our guide was written. Thus the guide refers to the installation.html
file you get when downloading JCo.
So please raise a ticket on support.sap.com on the component BC-MID-CON-JCO
to get help on this.
I'll close this issue for now, but please feel free to still comment here and if you have further questions or issues related to the Cloud SDK itself then I'll just re-open 😉
Hi @MatKuhr ,
the JCo itself works on my Mac OS (Intel) system. In the JCo subfolder examples I can run:
java com.sap.conn.jco.examples.client.beginner.CallUsingStructure
and get the output:
System info for A4H:
RFCPROTO: 011
RFCCHARTYP: 4103
RFCINTTYP: LIT
RFCFLOTYP: IE3
RFCDEST: vhcala4hci_A4H_00
RFCHOST: vhcala4h
RFCSYSID: A4H
RFCDATABS: A4H
RFCDBHOST: vhcala4hci
RFCDBSYS: HDB
RFCSAPRL: 757
RFCMACH: 390
RFCOPSYS: Linux
RFCTZONE: 0
RFCDAYST:
RFCIPADDR: 172.17.0.2
RFCKERNRL: 789
RFCHOST2: vhcala4hci
RFCSI_RESV:
RFCIPV6ADDR: 172.17.0.2
It would be great if someone from the Cloud SDK Team can check if the documentation still works.
Not sure how you ran it exactly, but it needs to be available to the application you are running. Not related to Cloud SDK and not anything we can help with, sorry.
Issue Description
I try to upgrade the Java part of my BTP connectivity test application HTML5UserAPIforCF. For that I've started from scratch and generated a Spring Boot project following the steps in the Getting started guide. You can find this project at sap-cloud-sdk-rfc. I've added the functionality to call a RFC Module following the documentation Call a BAPI/RFC Module. Before deploying to BTP Cloud Foundry I try to test local following Local Deployment. Here are my concrete steps before starting the app:
I've created a file called
/home/user/SAP_ABAP_BACKEND_RFC.jcoDestination
with the following content:jco.client.ashost=vhcala4hci.dummy.nodomain jco.client.sysnr=00 jco.client.client=001 jco.client.user=DEVELOPER jco.client.passwd= jco.client.lang=en
the path
/home/user
is also defined in the code RfcController.java#L29.Then I run:
export destinations="[{name: \"SAP_ABAP_BACKEND_RFC\"}]"
to provide this destination. Then I run:
When then accessing http://localhost:8080/rfc I see the following error in the console:
Impact / Priority
Affected development phase: Production
Impact: Blocked
Maven Dependency Tree
Checklist