[Mono-bugs] [Bug 76430][Wis] New - On mono remoting gives a object not registered error but on ms .net it works

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Oct 13 13:50:24 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by carlos at applianz.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76430

--- shadow/76430	2005-10-13 13:50:24.000000000 -0400
+++ shadow/76430.tmp.7627	2005-10-13 13:50:24.000000000 -0400
@@ -0,0 +1,208 @@
+Bug#: 76430
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Gentoo 64bit
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: carlos at applianz.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: On mono remoting gives a object not registered error but on ms .net it works 
+
+When running on mono the code I am copying at the end I get the exception
+copied below. The works just fine on ms.net. Furthermore I have another
+more complex piece of code that involves a webservice as the remoting
+client, in there the behaviour is even more strange, if the remoting method
+call uses only parameters passed in to it on the webservice method call
+then it works fine but if any of the parameters are instantiated during the
+web method execution then the remoting call gives the same "there are some
+fixups...." error.
+
+Here is the exception:
+============================================================
+Unhandled Exception: System.Runtime.Serialization.SerializationException:
+There are some fixups that refer to objects that have not been registered
+
+Server stack trace:
+in <0x0009a> System.Runtime.Serialization.ObjectManager:DoFixups ()
+in <0x00019>
+System.Runtime.Serialization.Formatters.Soap.SoapReader:get_TopObject ()
+in <0x00471>
+System.Runtime.Serialization.Formatters.Soap.SoapReader:Deserialize
+(System.IO.Stream inStream, ISoapMessage soapMessage)
+in <0x000c3>
+System.Runtime.Serialization.Formatters.Soap.SoapFormatter:Deserialize
+(System.IO.Stream serializationStream,
+System.Runtime.Remoting.Messaging.HeaderHandler handler)
+in <0x00026>
+System.Runtime.Serialization.Formatters.Soap.SoapFormatter:Deserialize
+(System.IO.Stream serializationStream)
+in <0x00247>
+System.Runtime.Remoting.Channels.SoapServerFormatterSink:ProcessMessage
+(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
+requestHeaders, System.IO.Stream requestStream, IMessage responseMsg,
+ITransportHeaders responseHeaders, System.IO.Stream responseStream)
+
+Exception rethrown at [0]:
+
+in <0x009a8> System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
+(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg,
+System.Exception exc, System.Object[] out_args)
+=============================================================
+
+Here is the shared interface:
+
+=============================================================
+ // The Interface
+using System;
+namespace BaseLib
+{
+	public abstract class BaseRemoteObject : MarshalByRefObject
+	{
+		public abstract void setValue(int pValue);
+		public Test test = null;
+		public abstract int  getValue();
+		public abstract string getText();
+	}
+	[System.Serializable]
+	public class Test
+	{
+		public String t = null;
+	}
+}
+=============================================================
+Server code:
+=============================================================
+// The Server
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+using System.Runtime.Remoting.Messaging;
+using System.Threading;
+
+using BaseLib;
+
+namespace Server
+{
+
+	class MyRemoteObject : BaseRemoteObject
+	{
+		int mValue;
+		public MyRemoteObject()
+		{
+			Console.WriteLine("MyRemoteObject ctor called. New remote object created");
+			if (this.test != null) Console.WriteLine("Value of test: " + this.test.t);
+			else Console.WriteLine("test is null");
+		}
+
+		public override void setValue(int pValue)
+		{
+			Console.WriteLine("MyRemoteObject.setValue() old={0} new={1}", mValue,
+pValue);
+			Console.WriteLine("Waiting 5 sec ...");
+			Thread.Sleep(5000);
+			mValue = pValue;
+			Console.WriteLine("Value is set");
+			Console.WriteLine("Value of test: " + this.test.t);
+		}
+
+		public override int getValue()
+		{
+			Console.WriteLine("MyRemoteObject.getValue()={0}", mValue);
+			Console.WriteLine("Value of test: " + this.test.t);
+			return mValue;
+		}
+
+		public override string getText()
+		{
+			Console.WriteLine("MyRemoteObject.getText() called");
+			Console.WriteLine("Waiting 5 sec ...");
+			Thread.Sleep(5000);
+			Console.WriteLine("Returning text");
+			return "Narendra";
+		}
+	} // class MyRemoteObject
+
+	class ServerStartup
+	{
+		[STAThread]
+		static void Main(string[] args)
+		{
+			Console.WriteLine("Starting server on port 1237...");
+			HttpChannel chnl = new HttpChannel(1237);
+			ChannelServices.RegisterChannel(chnl);
+
+			RemotingConfiguration.RegisterWellKnownServiceType(
+				typeof(MyRemoteObject), "MyRemoteObject.soap",
+WellKnownObjectMode.Singleton);
+			Console.WriteLine("Press  to exit");
+			Console.ReadLine();
+		}
+	}
+}
+
+=============================================================
+Client code:
+=============================================================
+  // The Client
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Http;
+
+using BaseLib;
+
+namespace ClientAsync
+{
+	class Client
+	{
+		delegate void SetValueDelegate(int pValue);
+		delegate int GetValueDelegate();
+		delegate string GetTextDelegate();
+		[STAThread]
+		static void Main(string[] args)
+		{
+			DateTime start = System.DateTime.Now;
+			HttpChannel chnl = new HttpChannel();
+			ChannelServices.RegisterChannel(chnl);
+			BaseRemoteObject obj = (BaseRemoteObject)
+Activator.GetObject(typeof(BaseRemoteObject),
+				"http://localhost:1237/MyRemoteObject.soap");
+			Test test = new Test();
+			test.t = "test";
+
+			obj.test = test;
+			SetValueDelegate svd = new SetValueDelegate(obj.setValue);
+			IAsyncResult arValSet = svd.BeginInvoke(625, null, null);
+			svd.EndInvoke(arValSet);
+
+			GetValueDelegate gvd = new GetValueDelegate(obj.getValue);
+			IAsyncResult arValGet = gvd.BeginInvoke(null, null);
+
+			Console.WriteLine("Client begin Async calls");
+			GetTextDelegate  gtd = new GetTextDelegate(obj.getText);
+			IAsyncResult arTxt = gtd.BeginInvoke(null, null);
+
+			int iVal = gvd.EndInvoke(arValGet);
+			string str = gtd.EndInvoke(arTxt);
+			Console.WriteLine("Client end Async calls");
+
+			Console.WriteLine("getValue={0} getText={1}", iVal, str);
+
+			DateTime end = System.DateTime.Now;
+			TimeSpan ts = end.Subtract(start);
+			Console.WriteLine("Client: Remote Execution took {0} seconds", ts.Seconds);
+		}
+	}
+}
+	    
+
+=============================================================


More information about the mono-bugs mailing list