tags:

views:

670

answers:

1

We have an issue that occurs from time to time. We have a web server and an application server. Our application server houses our Business Logic code which is installed as COM+ Server and Library applications. We then put a proxy on the web server to force all calls from the web server to the COM+ Server. Almost 100% of the time everything operates properly. Every once and a blue moon, and of course, only on a production machine, does this issue rear it's ugly head. Below is the event log entry that we are logging via the Enterprise Library.

It starts out logging this event log:

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)

Then this event log is logged after a later request.

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)

The stack traces go a little further, but it doesn't matter. Basically at the point it is occurring when it is supposed to jump from the web server to the COM+ server.

We can solve this problem by restarting the COM+ Server applications on the COM+ Server, but that is not a good enough of a solution for me...I am a fixer at heart.

These errors are not exactly being explicit with what is going on. Can anyone shed any light on what these errors mean and how to potentially avoid getting these errors?

Normally, I would never make a post like this. I guess the problem that I am having is with the nebulosity of the exception that is occurring. Doing a search on why this is happening is yielding very few results.

A: 

From what I can discern, the second message indicates that the remote procedure call failed meaning that the call to QueryInterface failed. This could be because of network interruption, a failure in the COM+ Server such as a hang, a timeout, or some other issue. If repeating the call works (without changing anything), then it was some sort of hang or timeout; if repeating the call subsequently fails every time, then the network is either down between the web server and the COM+ server, or the COM+ server has stopped working for some reason.

Could there by a memory leak or otherwise in the COM+ objects? Are the objects properly being released? Is a handle limit being reached? It might be worthwhile profiling the COM side and the web side of this to see that everyone is behaving nicely with object references.

Jeff Yates