SAP NCO 3.0库在调用RFCServer.Shutdown时抛出“ AccessViolationException”

问题描述 投票:0回答:1

我在使用[[SAP NCO 3.0库]时遇到问题,但是由于服务器错误500,甚至无法登录到他们的网站以在他们的论坛上发布。问题是我设置了一个RFCServer,以从SAP系统(功能表为

<i>IDOC_INBOUND_ASYNCHRONOUS</i>

)接收一个iDoc并进行一些处理的iDoc。 [当服务器正在接收大量文件并且用户关闭RFCServer时,SAP库抛出

<i>AccessViolationException</i>

,导致整个应用程序崩溃。
我已经尝试使用[HandleProcessCorruptedStateExceptions]属性来修饰封装的Shutdown方法,但仍未捕获到异常。

代码是:

public void Shutdown() { try { if (_SapServer != null) { _SapServer.Shutdown(false); } } catch (Exception e) { throw new Exception("Error stopping server", e); } if (_SapServer != null) { _SapServer.RfcServerError -= OnRfcServerError; _SapServer.RfcServerApplicationError -= OnRfcServerApplicationError; _SapServer.RfcServerStateChanged -= OnRfcServerStateChanged; _SapServer.TransactionIDHandler = null; } }

我已经将Shutdown(true)换成Shutdown(false),这告诉它中止正在运行的调用。

堆栈跟踪为:

“试图读取或写入受保护的内存。这通常表明其他内存已损坏。”

在STRCV(Byte *,Char *,Int32 *,Int32 *,Int32 *,Int32 *,Int32 *, Int32 *) 在 SAP.Middleware.Connector.CpicConnection.CpicReceive(Int32超时) 在SAP.Middleware.Connector.RfcConnection.Accept(Int32超时) 在SAP.Middleware.Connector.RfcConnection.RfcServerWorkerThreadProc(Object rfcConnObj) 在System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback回调,对象状态,布尔值 reserveSyncCtx) 在System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态,布尔值 reserveSyncCtx) 在System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()

位于System.Threading.ThreadPoolWorkQueue.Dispatch()

在sapnco_utils.dll中

[如果有人能指出正确的方向,因为我基本上已经走到了尽头。

我的SAP NCO 3.0库有问题,但由于服务器错误500,甚至无法登录其网站在其论坛上发布。问题是我将RFCServer设置为。 ..

c# .net sap access-violation
1个回答
0
投票
有点晚,但对于有相同问题的任何人,解决方法是确保将用于使CPIC响应保持活动状态的常规配置参数设置为false。
© www.soinside.com 2019 - 2024. All rights reserved.