時々発生する問題があります。Web サーバーとアプリケーション サーバーがあります。アプリケーション サーバーには、COM+ サーバーおよびライブラリ アプリケーションとしてインストールされるビジネス ロジック コードが格納されています。次に、Web サーバーにプロキシを配置して、Web サーバーから COM+ サーバーへのすべての呼び出しを強制します。ほぼ 100% の場合、すべてが適切に動作します。毎度ブルームーン、そしてもちろん、プロダクションマシンでのみ、この問題は醜い頭の後ろで発生します。以下は、エンタープライズ ライブラリを介してログに記録しているイベント ログ エントリです。
このイベント ログの記録から開始します。
Type : System.InvalidCastException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Unable to cast object of type 'System.__ComObject' to type 'System.EnterpriseServices.IRemoteDispatch'.
Source : System.EnterpriseServices
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Runtime.Remoting.Messaging.IMessage Invoke(System.Runtime.Remoting.Messaging.IMessage)
Stack Trace : at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
その後、このイベント ログは、後の要求の後に記録されます。
Type : System.InvalidCastException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Unable to cast COM object of type 'System.__ComObject' to interface type 'System.EnterpriseServices.IRemoteDispatch'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{6619A740-8154-43BE-A186-0319578E02DB}' failed due to the following error: The remote procedure call failed. (Exception from HRESULT: 0x800706BE).
Source : System.EnterpriseServices
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Runtime.Remoting.Messaging.IMessage Invoke(System.Runtime.Remoting.Messaging.IMessage)
Stack Trace : at System.EnterpriseServices.RemoteServicedComponentProxy.Invoke(IMessage reqMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
スタック トレースはもう少し続きますが、問題ありません。基本的に、Web サーバーから COM+ サーバーにジャンプすることになっている時点で発生しています。
この問題は、COM+ サーバー上で COM+ サーバー アプリケーションを再起動することで解決できますが、私にとっては十分な解決策ではありません.
これらのエラーは、何が起こっているのかを明確に示しているわけではありません。これらのエラーの意味と、これらのエラーの発生を潜在的に回避する方法について、誰かが光を当てることができますか?
通常、私はこのような投稿をすることはありません。私が抱えている問題は、発生している例外の曖昧さにあると思います。なぜこれが起こっているのかを検索しても、ほとんど結果が得られません。