点击此处---> 群内免费提供SAP练习系统(在群公告中)
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
尊敬的专家,
当我尝试使用SAP Cloud SDK for Java在S/4 HANA上调用远程功能模块时,发生以下异常。
java.lang.ClassNotFoundException:com.sap.conn.jco.JCoException
该应用程序已部署在SAP Cloud Platform CF应用程序运行时。
有人知道如何处理此问题吗?
代码如下。
软件包com.sap.cloud.sdk; 导入com.google.gson.Gson; 导入com.sap.cloud.sdk.cloudplatform.connectivity。*; 导入com.sap.cloud.sdk.s4hana.connectivity.exception.RequestExecutionException; 导入com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmRequest; 导入com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmRequestResult; 导入org.slf4j.Logger; 导入org.slf4j.LoggerFactory; 导入javax.servlet.annotation.WebServlet; 导入javax.servlet.http.HttpServlet; 导入javax.servlet.http.HttpServletRequest; 导入javax.servlet.http.HttpServletResponse; 导入java.io.IOException; @WebServlet("/img/bapi") 公共类BapiServlet扩展了HttpServlet { 私有静态最终长serialVersionUID = 1L; 私有静态最终Logger logger = LoggerFactory.getLogger(BapiServlet.class); 私有静态最终目标destinationRfc = DestinationAccessor.getDestination(" Erp1809rfc"); @Override 受保护的void doGet(最终HttpServletRequest请求,最终HttpServletResponse响应) 引发IOException { logger.info("开始获取方法:" + request.getRequestURI()); 可迭代的名称= destinationRfc.getPropertyNames(); logger.info(new Gson()。toJson(names)); 尝试{ 最终的RfmRequestResult rfmTest =新的RfmRequest(" RFCPING") .execute(destinationRfc); response.setContentType(" application/json"); response.setCharacterEncoding(" UTF-8"); response.getWriter()。write(new Gson()。toJson(rfmTest)); } catch(RequestExecutionException e){ e.printStackTrace(); } } }
日志如下。
2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]出[CONTAINER] a]。[localhost]。[/]。[com.sap.cloud.sdk.BapiServlet]严重 带有路径[]的上下文中Servlet [com.sap.cloud.sdk.BapiServlet]的Servlet.service()抛出异常 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT com.sap.cloud.sdk.cloudplatform.exception.ShouldNotHappenException:com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException :javax.servlet.ServletException:Servlet执行引发异常 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.doFilter(RequestAccessorFilter.java:74)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.security.servlet.HttpCachingHeaderFilter.doFilter(HttpCachingHeaderFilter.java:83)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.security.servlet.HttpSecurityHeadersFilter.doFilter(HttpSecurityHeadersFilter.java:41)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.filters.RestCsrfPreventionFilter.doFilter(RestCsrfPreventionFilter.java:116)处输出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.cloudfoundry.router.ClientCertificateMapper.doFilter(ClientCertificateMapper.java:79)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)上退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:861)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint.java:1579)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)处输出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在java.lang.Thread.run(Thread.java:748)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT原因:com.sap.cloud.sdk.cloudplatform.thread.exception.ThreadContextExecutionException:javax.servlet.ServletException:Servlet执行抛出异常 例外 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:325)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.doFilter(RequestAccessorFilter.java:71)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT ...更多32 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT原因:javax.servlet.ServletException:Servlet执行引发异常 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:238)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.servlet.RequestAccessorFilter.lambda $ doFilter $ 1(RequestAccessorFilter.java:71)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.lambda $ execute $ 0(AbstractThreadContextExecutor.java:317)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.thread.ThreadContextCallable.call(ThreadContextCallable.java:247)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.cloudplatform.thread.AbstractThreadContextExecutor.execute(AbstractThreadContextExecutor.java:319)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT ...更多33 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT原因:java.lang.NoClassDefFoundError:com/sap/conn/jco/JCoException 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmTransactionFactory.createJCoTransaction(RfmTransactionFactory.java:32)处输出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.s4hana.connectivity.rfc.AbstractTransactionFactory.createTransaction(AbstractTransactionFactory.java:39)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.s4hana.connectivity.rfc.RemoteFunctionRequestExecutor.execute(RemoteFunctionRequestExecutor.java:41)上退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.s4hana.connectivity.rfc.RfmRequest.execute(RfmRequest.java:102)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在com.sap.cloud.sdk.BapiServlet.doGet(BapiServlet.java:47)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在javax.servlet.http.HttpServlet.service(HttpServlet.java:634)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在javax.servlet.http.HttpServlet.service(HttpServlet.java:741)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)处退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT ...更多41 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT原因:java.lang.ClassNotFoundException:com.sap.conn.jco.JCoException 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0]在org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)退出 2020-03-27T17:40:00.72 + 0900 [APP/PROC/WEB/0] OUT ... 49更多
此致
Yohei
一周热门 更多>