Security problem iwth ObjRef
- From: Roy Chastain <roy@xxxxxxxxx>
- Date: Fri, 27 May 2005 07:50:00 -0400
My client application received the exception below. This was returned from my server application.
Because of security restrictions, the type System.Runtime.Remoting.ObjRef cannot be accessed.
I know exactly what line of code caused this but I do not know why or exactly what it means. Here is the overview.
I have a server that creates one SAO and clients that can create several CAOs. The CAO needs to be sponsored, so I have a class
in the client that derives from MarshalByRefObject and implements ISponsor as below.
public class SponsordCAOSponsor: MarshalByRefObject, ISponsor
{
public override object InitializeLifetimeService ()
{
return null;
}
public TimeSpan Renewal (ILease lease)
{
// do work and return appropriate TimeSpan
}
}
I register this class as the sponsor of the CAO just after the CAO is created and marshaled. The problem was that Renewal was
never being called. I decided to check things out by having the server code call Renewal just to see if it was callable and
actually got called in the correct context. The result was the exception above. I changed the call to Renewal to a call on a
different method in the class and it completed and completed on the client as expected.
FYI. I believe (because I have managed to get server to client event notification working) that I have correctly setup 2 way
channels so that the server code can access the client side created sponsor.
Any explanation of the exception or ideas as to why Renewal is not being called when the lease is ready to expire would be most
appreciated.
Thanks
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
.
- Prev by Date: RE: Server requesting a client
- Next by Date: Re: Questions about MarshalByRefObject.InitializeLifetimeService
- Previous by thread: Help! Cannot invoke methods on IRemoteDispatch
- Next by thread: Remoting Web Service --- Interoperability
- Index(es):
Relevant Pages
|