Groups | Blog | Home
all groups > dotnet remoting > june 2005 >

dotnet remoting : Remoted object reference dies unexpectedly



compurhythms NO[at]SPAM gmail.com
6/30/2005 10:10:45 AM
've got a client app that communicates to a server EXE via Remoting
(TCP/Binary Serializer). Most of the time things work just smashingly
except that at seemingly random times a call to the server process
will fail with the following exception:

"... RemotingException: Requested Service not found" . Seems easy
enough, the server is not running or has not established the endpoint
you might say. The problem is the server is running and the endoint
is established. Not only that, but the following are true as well:

---------------
- The server activated object reference has already had a number of
successful method invocations performed on it

- The lease is infinite on the object

- The server side call stack shows the call failing in the guts of the
remoting code:
"Server stack trace: at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders,
Stream requestStream, IMessage& responseMsg, ITransportHeaders&
responseHeaders, Stream& responseStream)"

- When the exception occurs, no more successful calls can be made on
the remoted object reference from the existing client app, but if I
launch another client app instance and make method invocations on
another SAO they work just fine
------------

I find it interesting that the call actually makes it to the server
side but I still get the "Requested Service not found" message.

The parameters of the methods are mostly simple types, with a few that
are structs that contain simple types (strings, ints, etc). On the
client side, the remoting channel is established by registering the
well-known-type of server objects in the app.config.

I've tried to create a small set of sample code to reproduce the issue
but I've haven't been able to do so.

There are only two things that seem suspect to me:

1. there is a possibilty of a method being invoked on the same object
simultaneously from two different threads. This theory hasn't really
panned out because logs show that this never happens in practice (even
live logs from when the exception occurs)
2. some of the objects whose methods we invoke are actually not
objects that are explicitly listed as well-known-types in the
app.config, but are merely instances that are returned from methods of
a remoted class. e.g:

class RemotedClass
{
public SecondaryClass GetSecondaryObject()
{
return new SecondaryClass();
}
}

I'm unclear as to what the lease policy and object disposition (SAO or
CAO) of objects returned from a remoted object's methods would be.

I've exhausted my options w/r/t Google/docs/FAQ searches, so I was
wondering if anyone else had ever seem similar behavior, or might have
an explanation as to why my remoted object reference seems to go dead.

Mike
--
http://hole19.compurhythms.com
Sergey Radkevich
7/3/2005 12:00:00 AM
[quoted text, click to view]

When you request such object from client, the return value is packed into
IMessage.Properties["__Return"].
When it comes to BinaryFormatter, serialization occurs. In that time object
is marshalled and registered inside remoting infrastructure.

During serialization new ObjRef is created for this object.
ObjRef for this object contains URI which is different from the URI for the
object of RemotedClass.

Remoting manages lifetime of second object in similar way as it manages
lifetime for other objects (i.e. using leases and sponsors).
So the first thing to do is to implement InitializeLifetimeService() on
SecondaryClass.

WBW,
Sergey.
http://sergey.radkevich.ru

Roy Chastain
7/14/2005 11:59:56 AM
Hi Mike,
Have you made any progress on this issue?

Sorry to do a 'me too', but trying to share information.

I too have had the same problem since day one of my remoting work. I have managed to reproduce this behavior in a production
application and in two different test beds. Obviously, I am consistent.

I can reproduce it by simply letting the client connect and call a method on the server and then just wait some amount (not
predictable) before calling the server object again. In my testing, I am the only client accessing the server, so I know it is
not a concurrent use issue.

In one of the applications, the object is a SingleCall SAO, which in my opinion should not need lifetime service/lease management.
After all the object is supposed to go away.

I THINK that all this has something to do with the idle time on the channel, but no one has been able to explain any of those
parameters to my satisfaction.



[quoted text, click to view]

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
Emidio
10/28/2005 12:00:00 AM
Again, "me too". I am having the exact same problem. I have seen some messages stating that it may be a name resolution problem ( localhost vs. netbios name ), but that does not seem like the case to me, since it works fine for a while and then dies whenever it feels like it.

From http://www.developmentnow.com/g/24_2005_6_0_0_552794/Remoted-object-reference-dies-unexpectedly.htm

Posted via DevelopmentNow.com Groups
Emidio
10/28/2005 12:00:00 AM
Again, "me too". I am having the exact same problem. I have seen some messages stating that it may be a name resolution problem ( localhost vs. netbios name ), but that does not seem like the case to me, since it works fine for a while and then dies whenever it feels like it

From http://www.developmentnow.com/g/24_2005_6_0_0_552794/Remoted-object-reference-dies-unexpectedly.ht

Posted via DevelopmentNow.com Group
AddThis Social Bookmark Button