[Mono-bugs] [Bug 75607][Cri] New - Remoting Serialization problem
using System.Collections.CollectionBase
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Fri Jul 22 10:43:28 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 cireddu at dylog.it.
http://bugzilla.ximian.com/show_bug.cgi?id=75607
--- shadow/75607 2005-07-22 10:43:28.000000000 -0400
+++ shadow/75607.tmp.29358 2005-07-22 10:43:28.000000000 -0400
@@ -0,0 +1,181 @@
+Bug#: 75607
+Product: Mono: Runtime
+Version: 1.1
+OS: other
+OS Details: Debian Sarge
+Status: NEW
+Resolution:
+Severity: 001 One hour
+Priority: Critical
+Component: remoting
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: cireddu at dylog.it
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Remoting Serialization problem using System.Collections.CollectionBase
+
+Please fill in this template when reporting a bug, unless you know what
+you are doing.
+Description of Problem:
+I am attempting to send a class (that derives from
+System.Collections.CollectionBase and implement the ISerializable
+interface) as a method's parameter of a remoting object. The client is a
+Windows XP .Net 1.1 and the server is Linux(Debian v3.1, Sarge). This
+action causes a Serialization Exception.
+
+Steps to reproduce the problem:
+1. Instantiate the derived class NameObjectCollection:
+ NameObjectCollection myColl = new NameObjectCollection();
+
+2. Add items to myColl
+ myColl.Add("ITEM1", "VALUE1");
+ myColl.Add("ITEM2", "VALUE2")
+
+3. Call a remote method:
+ string result = myRemoteObject.GetResult(myColl);
+
+
+Actual Results:
+System.Runtime.Serialization.SerializationException: The object is not a
+SerializationInfo
+
+Server stack trace:
+in <0x002db>
+System.Collections.Specialized.NameObjectCollectionBase:OnDeserialization
+(System.Object sender)
+in <0x000ec>
+System.Runtime.Serialization.ObjectManager:RaiseDeserializationEvent ()
+in <0x00049>
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadNextObject
+(System.IO.BinaryReader reader)
+in <0x000b0>
+System.Runtime.Serialization.Formatters.Binary.ObjectReader:ReadObjectGraph
+ (System.IO.BinaryReader reader, Boolean readHeaders, System.Object
+result, System.Runtime.Remoting.Messaging.Header[] headers)
+in <0x0024c>
+System.Runtime.Serialization.Formatters.Binary.MessageFormatter:ReadMethodC
+all (System.IO.BinaryReader reader, Boolean hasHeaders,
+System.Runtime.Remoting.Messaging.HeaderHandler headerHandler,
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter)
+in <0x000bb>
+System.Runtime.Serialization.Formatters.Binary.BinaryFormatter:Deserialize
+(System.IO.Stream serializationStream,
+System.Runtime.Remoting.Messaging.HeaderHandler handler)
+in <0x00155>
+System.Runtime.Remoting.Channels.BinaryServerFormatterSink:ProcessMessage
+(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders
+requestHeaders, System.IO.Stream requestStream, IMessage responseMsg,
+ITransportHeaders responseHeaders, System.IO.Stream responseStream)
+
+Exception rethrown at [0]:
+ at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage
+(IMessage reqMsg, IMessage retMsg)
+ at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
+msgData, Int32 type)
+ at General.IDataAccessManager.GetRicercaResult(NameObjectCollection
+coll, String whereClause)
+ at MyDocs.NewArchivio.GetSourceForGrid()
+ at MyDocs.NewArchivio.AddNewSearch(String selection)
+ at MyDocs.MainForm.dotNetBarManager1_ItemClick(Object sender, EventArgs
+e)
+ at DevComponents.DotNetBar.DotNetBarManager.9D(BaseItem 2KR)
+ at DevComponents.DotNetBar.BaseItem.RaiseClick()
+ at DevComponents.DotNetBar.BaseItem.InternalMouseUp(MouseEventArgs
+objArg)
+ at DevComponents.DotNetBar.PopupItem.InternalMouseUp(MouseEventArgs
+objArg)
+ at DevComponents.DotNetBar.ButtonItem.InternalMouseUp(MouseEventArgs
+objArg)
+ at DevComponents.DotNetBar.BaseItem.InternalMouseUp(MouseEventArgs
+objArg)
+ at DevComponents.DotNetBar.GenericItemContainer.InternalMouseUp
+(MouseEventArgs objArg)
+ at DevComponents.DotNetBar.Bar.OnMouseUp(MouseEventArgs e)
+ at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
+button, Int32 clicks)
+ at System.Windows.Forms.Control.WndProc(Message& m)
+ at DevComponents.DotNetBar.Bar.WndProc(Message& m)
+ at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
+ at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
+ at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
+IntPtr wparam, IntPtr lparam)
+
+Expected Results:
+No exception throw.
+
+How often does this happen?
+Always.
+
+Additional Information:
+Here are the classes being transferred:
+[Serializable]
+public class NameObjectCollection :NameObjectCollectionBase ,ISerializable
+{
+
+ public NameObjectCollection()
+ {
+ }
+
+ public void Add(string name, object value)
+ {
+ base.BaseAdd(name, value);
+ }
+
+ public void Add(object value)
+ {
+ int counter = base.Count + 1;
+ string key = "k_" + counter.ToString() ;
+ base.BaseAdd( key, value);
+ }
+
+ public void Remove(string name)
+ {
+ base.BaseRemove(name);
+ }
+
+ public object this[string name]
+ {
+ get
+ {
+ return base.BaseGet(name);
+ }
+ }
+
+ public object this[int i]
+ {
+ get
+ {
+ return base.BaseGet(i);
+ }
+ }
+
+ public NameObjectCollection (SerializationInfo infStreamingContext
+context)
+ {
+ SerializationInfoEnumerator infoItems = info.GetEnumerator
+();
+ while(infoItems.MoveNext())
+ {
+ base.BaseAdd(infoItems.Name, infoItems.Value);
+ }
+ }
+
+ //Populates a SerializationInfo with the data needed to
+serialize the target object
+ public override void GetObjectData(SerializationInfo info,
+StreamingContext context)
+ {
+ foreach(string name in base.BaseGetAllKeys())
+ {
+ try
+ {
+ info.AddValue(name, base.BaseGet(name));
+ }
+ catch(Exception)
+ {
+ }
+ }
+ }
+}
More information about the mono-bugs
mailing list