473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Unable to cast object of type" error

Hi All,

I have a class A which is derived from ServicesCompone nt to participate in automatic transaction with falg Transaction.Req uired. 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.HydraPlatf orm.CoreService s.ServerSOAPBin ary.Administrat ion.MaintainSer verService to type

Hclt.HydraPlatf orm.CoreService s.ServerSOAPBin ary.Administrat ion.MaintainSer verService.
Source: mscorlib
Message: Unable to cast object of type

Hclt.HydraPlatf orm.CoreService s.ServerSOAPBin ary.Administrat ion.MaintainSer verService to type

Hclt.HydraPlatf orm.CoreService s.ServerSOAPBin ary.Administrat ion.MaintainSer verService.
StackTrace: at System.Runtime. InteropServices .Marshal.GetTyp edObjectForIUnk nown(IntPtr

pUnk, Type t)
at System.Enterpri seServices.Serv icedComponentPr oxyAttribute.Cr eateInstance(Ty pe

serverType)
at

System.Runtime. Remoting.Activa tion.Activation Services.Create InstanceWithLin kDemand(ProxyAt tri

bute pa, Type serverType)
at System.Runtime. Remoting.Activa tion.Activation Services.IsCurr entContextOK(Ty pe

serverType, Object[] props)
at Hclt.HydraPlatf orm.Dts.Operati onTI.DTSExposed Operations.Send UserInterventio n(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 7369

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
33512
by: Lou Pecora | last post by:
g++ compiler error question. I have a container C whose constructor takes a class B that is inherited from an abstract class A. So I have the line of code: B binstance; C cinstance(binstance); The compiler gives the error,
7
36683
by: deko | last post by:
I'm getting intermittent "Object Invalid or No Longer Set" errors in my Access 2002 mdb. What causes these errors? Has anyone dealt with this before? I can't trace it because it's not easy to duplicate -- it just show up... I've heard that spurious queries that use Now() or Date() or some other date
6
19933
by: Lauchlan M | last post by:
Hi. Usin ASP.NET, getting an "Object reference not set to an instance of an object" error. In my login.aspx page I have: string arrUserRoles = new string {"UserRole"}; Context.Items.Add("UserRoles", arrUserRoles); Context.User = new
1
2345
by: Lauchlan M | last post by:
Hi. I'm using ASP.NET, getting an "Object reference not set to an instance of an object" error. In my login.aspx page I have: string arrUserRoles = new string {"UserRole"}; Context.Items.Add("UserRoles", arrUserRoles); Context.User = new
0
1578
by: Peter Afonin | last post by:
Hello: When I try to access a SQL server or a network share from an ASP.Net application that I run on my computer, I run into security problems (for instance, I cannot execute DTS package using Trusted connection or get a file information using FileInfo class). This is probably because my application is running under PETER\ASPNET account,...
10
1634
by: roy.anderson | last post by:
Error is thus: "Cast from type 'DBNull' to type 'String' is not valid." Simple, right? Well, no (or at least not for me). Here's a function, followed by the calling code below: Function GetDetails(ByVal x As String, ByVal y as String) Dim conn As New SqlConnection ("server=localhost;uid=blah;pwd=blah;database=test") Dim strSQL As String...
0
1733
by: hamstak | last post by:
While attempting to perform a build on an .aspx page from within VS 2005 I receive the "Could not load type" error pertaining to the class representing the page. The class is derived from a custom base class (which itself is derived from System.Web.UI.Page). This custom base class has been used in other projects successfully. The Inherits...
2
2967
by: louie.hutzel | last post by:
This JUST started happening, I don't remember changing any code: When I click the submit button on my form, stuff is supposed to happen (which it does correctly) and a result message is posted back to the same page at the top of my form alerting the user that their request has been approved or denied. However, the end result is an error...
3
12508
by: eros | last post by:
ALTER TABLE public.postcodes ALTER COLUMN machi TYPE varchar(100); Error: ERROR: syntax error at or near "TYPE"; Error while executing the query (State:42601, Native Code: 7) I am using WinSQL, Windows XP SP2 Japanese Version, PostgreSQL 8.x. I want to alter my machi field from varchar(30) to varchar(100) TYPE. This is my CREATE...
5
2309
by: piyumi80 | last post by:
hi, i write the following code to get a specific data row from the data set.but it generates the "Object reference not set to an instance of an object.".....error private void showClientListForUser() { string fkeys = new string; fkeys = txtUserName.Text; fkeys = txtUserCompanyNumber.Text;
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.