472,119 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

"Unable to cast object of type" error

Hi All,

I have a class A which is derived from ServicesComponent to participate in automatic transaction with falg Transaction.Required. Class A is exposed to client through remoting on Http channal hosting into IIS.
There is a class B which is also available through remoting hosted on IIS on the same URI. B creates new of A inside a function. It succeed and able to create instance of A inside B first time. But it failes in 2nd attempt when we retry to create the instance of A inside B. But if we restart the IIS then we are able to create instance of A first time.

Instance of Class B is created from a script written inside the MS exchange server.

Please help us to find the reason behind it.

exact exception which we had traced is:
"An error occured: Unable to cast object of type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService to type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService.
Source: mscorlib
Message: Unable to cast object of type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService to type

Hclt.HydraPlatform.CoreServices.ServerSOAPBinary.A dministration.MaintainServerService.
StackTrace: at System.Runtime.InteropServices.Marshal.GetTypedObj ectForIUnknown(IntPtr

pUnk, Type t)
at System.EnterpriseServices.ServicedComponentProxyAt tribute.CreateInstance(Type

serverType)
at

System.Runtime.Remoting.Activation.ActivationServi ces.CreateInstanceWithLinkDemand(ProxyAttri

bute pa, Type serverType)
at System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type

serverType, Object[] props)
at Hclt.HydraPlatform.Dts.OperationTI.DTSExposedOpera tions.SendUserIntervention(String

inSender, String sProjectCode, Int32 nDefectId, String sPhase, String sModuleId, Int32

iProcessId, Int32 nInterveneType, String sOwner, String sRole)"
Any help would be incredible for us becasue it making our application inconsistant behaviour.

regads,
Pankaj Jain,
Project Leader,
HCL Technologies India
Jul 21 '05 #1
0 7237

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Lou Pecora | last post: by
reply views Thread by Peter Afonin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.