0

AutoSys と WebSphere MQ がインストールされている Windows Server 2008 で実行される .NET コンソール アプリケーションがあります (アプリケーションは WebSphere MQ にメッセージを送信するために使用されます)。

コンソール アプリケーションを 10 分ごとに呼び出す AutoSys ジョブを設定しようとしています。

サーバーにログインし、コマンド ラインを使用してアプリケーションを実行すると、アプリケーションは正しく動作します。

しかし、AutoSys を使用してアプリケーションを実行すると、次のエラーが発生します。

The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.

StackTrace =    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
   at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\SendMessage\QueueJobExecutionItem.cs:line 36
   at SendMessage.Program.StartLoad() in C:\SendMessage\Program.cs:line 75
   at SendMessage.Program.Main(String[] args) in C:\SendMessage\Program.cs:line 111

Error Message InnerException = The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception.

InnerException StackTrace =    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties)
   at SendMessage.QueueJobExecutionItem.ExecuteQueueJob(QueueInfo queueInfo, CrmInfo crmInfo, LogFileInfo logFileInfo, List`1 entityList) in C:\SendMessage\QueueJobExecutionItem.cs:line 36
   at SendMessage.Program.StartLoad() in C:\SendMessage\Program.cs:line 75
   at SendMessage.Program.Main(String[] args) in C:\SendMessage\Program.cs:line 111

InnerException Source = amqmdnet

Error Message InnerException = Exception has been thrown by the target of an invocation.

InnerException StackTrace =    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at IBM.WMQ.CommonServices.CreateCommonServices()
   at IBM.WMQ.CommonServices.TraceConstructor(String objectId, String sccsid)
   at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
   at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
   at IBM.WMQ.MQQueueManager..cctor()

InnerException Source = mscorlib

Error Message InnerException = An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

InnerException StackTrace =    at IBM.WMQ.MQCommonServices.xcsInitialize(UInt16 scope, UInt16 attributes, Byte[] charName, Byte[] charPrefix, xcsHPOOL& hPool)
   at IBM.WMQ.MQCommonServices.Initialize()

InnerException Source = amqmdxcs

サーバーにログインしてAutoSysを実行するときに同じユーザーを使用しているため、アプリケーションが同じ方法で実行されると予想していました。

誰かが以前にこの問題を抱えていたのか、それともサーバーにログインしたときと同じようにアプリケーションを動作させる AutoSys に欠けている可能性のある構成/パラメーターなどがあるのか​​ どうか疑問に思っています。

これが理にかなっていることを願っています

前もって感謝します

4

1 に答える 1

1

An attempt was made to load a program with an incorrect format.これは、アプリケーションが 64 ビットであるが 32 ビット バージョンのWMQamqmdxcs.dllライブラリをロードしようとしているか、またはアプリケーションが 32 ビットであるが 64 ビット バージョンの WMQ ライブラリをロードしようとしていることが原因である可能性があります。AutoSys のビット数を確認し、適切な WMQ ライブラリをロードするパスを設定する必要があります。

于 2013-04-16T08:26:12.270 に答える