如何克服“sap . middleware . connector . rfcconfigparameter”的类型初始

本文关键字:rfcconfigparameter connector 类型 middleware sap 何克服 克服 | 更新日期: 2023-09-27 18:11:01

我们有通过DCOM SAP连接器从SAP系统获取数据的应用程序。最近我们用。net连接器代替了。net连接器。在部署到生产环境后,它只工作了一天。突然,它在访问一个RFC时给出了指定的错误。异常消息为

"SAP.Middleware.Connector"的类型初始化器。RfcConfigParameters"抛出了一个异常- Error#:-2146233036.

为SAP.Middleware.Connector.RfcConfigParameters创建对象并使用的代码如下

string Value1 ="Val1";
string Value1 ="Val2";
string Value1 ="Val3";
string Value1 ="Val4";
string Value1 ="Val5";
string Value1 ="Val6";
string Value1 ="Val7";
RfcConfigParameters parms = new RfcConfigParameters();
parms.Add(RfcConfigParameters.Param1, Value1);
parms.Add(RfcConfigParameters.Param2, Value2);
parms.Add(RfcConfigParameters.Param3, Value3);
parms.Add(RfcConfigParameters.Param4, Value4);
parms.Add(RfcConfigParameters.Param5, Value5);
parms.Add(RfcConfigParameters.Param6, Value6);
parms.Add(RfcConfigParameters.Param7, Value7);
SapRfcDestination = RfcDestinationManager.GetDestination(parms);
RfcCustomDestination customDest = SapRfcDestination.CreateCustomDestination();
IRfcFunction func = customDest.Repository.CreateFunction("RFC_FUNCTION");
func.SetValue("DATA1", "VAL1")
func.SetValue("DATA2", "VAL2")
func.SetValue("DATA3", "VAL3")
RfcStructureMetadata metaData = customDest.Repository.GetStructureMetadata("STRUCTURENAME");
IRfcTable rfcTable = func.GetTable("TABLENAME");

我们已经跟踪了异常信息,下面是异常信息

System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load.
 ---> System.IO.FileLoadException: Could not load file or assembly 'msvcm80, Version=8.0.50727.6195, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
File name: 'msvcm80, Version=8.0.50727.6195, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at <CrtImplementationDetails>.DoDllLanguageSupportValidation()
   at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )

   --- End of inner exception stack trace ---
   at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException)
   at <CrtImplementationDetails>.ThrowModuleLoadException(String , Exception )
   at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
   at .cctor()
   --- End of inner exception stack trace ---
   at SAP.Middleware.Connector.RfcConfigParameters..cctor()- Stack trace:   at SAP.Middleware.Connector.RfcConfigParameters..ctor()

以下是我们的观察结果
1. 这不是总是抛出问题。问题断断续续地抛出。
2. 当我们转到服务器机器并在那里运行应用程序时,它不会抛出错误。只有当应用程序从其他客户端机器访问时才会抛出错误。
3.同样的问题在开发、测试和阶段环境中不会重现。这只是生产中的问题4. 如果我们重新部署特定的dll,它将在一天或半天内开始工作而没有任何错误,然后在第二天抛出错误。

我的具体问题是(1)如何克服"SAP.Middleware.Connector的类型初始化器"的异常。RfcConfigParameters"抛出了一个异常-错误#:-2146233036"?
(2)我们的主要怀疑领域是内存泄漏。我们还能怀疑其他地方吗?
(3)我们对生产环境的访问非常有限,甚至没有。所以我们试图在其他服务器上重现这个问题,我们有完全的访问权限,比如开发和测试。我们正在考虑多用户和多登录场景,以便在其他环境中重现该问题。我们能考虑其他情况吗?


我们设法在我们的一个测试服务器上重现了这个问题。并尝试了以下方法来解决这个问题。并安装了Visual c++ 2005 Redistributable SP1、。net connector 3.0和VB6.0。问题仍然存在。我们无法找到问题的根本原因。

为了找到问题的根本原因,我还可以检查和做什么?

基于响应的编辑:
1. 我们没有使用任何静态变量2. 我们已经安装了Visual c++ 2005 Redistributable SP1。但还是没有解决问题。

如何克服“sap . middleware . connector . rfcconfigparameter”的类型初始

这个线程建议安装Visual c++ 2005 Redistributable SP1包解决这个问题。(由于sapnco_utils.dll中的依赖)

经过大量的分析和深入的研究,我们找到了解决这个问题的办法。

我们正在使用SAP 3.0.4。当我们查看3.0.9的最新SAP连接器发布说明时,如下所示:

改进:终止配置异常当没有指定所需的配置参数时,例如SYSID,当尝试通过负载平衡连接时,抛出了一个非常低级的异常,目前还不清楚,为什么这种联系不可能建立。现在,有早期的检查,以防配置问题,RfcConfigurationException是一个描述性的RfcConfigurationException配置问题。

节选自SAP Connector 3.0.8

发行说明3.0.8*错误修复:目标配置的配置来更改目标的跟踪级别目标对该目标的TraceLevel属性没有影响,即使触发了配置更新事件。

因此,我们安装了最新的SAP连接器3.0.10,并使用最新的SAP连接器dll (sapnco.dll和sapnco_utils.dll)重新构建dll。有了这些最新的dll,问题得到了解决。

相关文章:
  • 没有找到相关文章