[Mono-bugs] [Bug 78039][Cri] Changed - Getting error message when creating instance of a Client Activated Object (CAO)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Apr 7 02:03:28 EDT 2006


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 diegoflorez84 at gmail.com.

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

--- shadow/78039	2006-04-07 01:58:09.000000000 -0400
+++ shadow/78039.tmp.11444	2006-04-07 02:03:28.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 78039
 Product: Mono: Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: Fedora Core 4
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Critical
 Component: remoting
 AssignedTo: lluis at ximian.com                            
 ReportedBy: diegoflorez84 at gmail.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -47,6 +47,141 @@
 
 How often does this happen? 
 Always.
 
 Additional Information:
 N/A.
+
+------- Additional Comments From diegoflorez84 at gmail.com  2006-04-07 02:03 -------
+Here's the code of the Client/Server Application:
+
+//Object
+using System;
+
+namespace RemotingApp
+{
+    public class RemotingObj : MarshalByRefObject
+    {
+        int number = 5;
+       
+        public int calculate()
+        {
+            return number * number * number;
+        }
+    }
+}
+
+//Server
+using System;
+using System.Data;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+namespace RemotingApp
+{
+    class Server
+    {
+        public static void Main(string[] args)
+        {
+            ChannelServices.RegisterChannel(new TcpChannel(8888));
+           
+            //Registering a Server Activated Object (SAO) --> works on
+client
+           
+RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemotingApp.RemotingObj),
+"RemotingObj", WellKnownObjectMode.Singleton);
+           
+            //Registering a Client Activated Object (CAO) --> doesn't
+work on client
+            RemotingConfiguration.ApplicationName = "remApp";
+           
+RemotingConfiguration.RegisterActivatedServiceType(typeof(RemotingApp.RemotingObj));
+           
+            Console.WriteLine("Executing Server... press Enter to
+finish");
+            Console.ReadLine();
+        }
+    }
+}
+
+//Client
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+using System.Runtime.Remoting.Activation;
+
+namespace RemotingApp
+{
+    class Client
+    {
+        public static void Main(string[] args)
+        {
+            ChannelServices.RegisterChannel(new TcpChannel());
+           
+            //Using Server Activated Object (SAO) --> works OK
+            RemotingObj ob1 = (RemotingObj)
+Activator.GetObject(typeof(RemotingApp.RemotingObj),
+"tcp://localhost:8888/RemotingObj");
+            Console.WriteLine(ob1.calculate());
+           
+            //Using Client Activated Object (CAO) --> doesn't work
+            object[] attrs = {new
+UrlAttribute("tcp://localhost:8888/remApp")};
+            ObjectHandle handle =
+Activator.CreateInstance("RemotingObj", "RemotingApp.RemotingObj", attrs);
+            RemotingObj ob2 = (RemotingObj) handle.Unwrap();
+           
+            Console.WriteLine(ob2.calculate());
+        }
+    }
+}
+
+This is the error message appears when the application crashes:
+
+Unhandled Exception: System.Reflection.TargetInvocationException:
+Exception has been thrown by the target of an invocation. --->
+System.Runtime.Remoting.RemotingException: Requested service not found
+(System.Runtime.Remoting.Activation.IActivator, mscorlib,
+Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089).
+No receiver for uri remApp/RemoteActivationService.remin [0x00188] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:219)
+System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
+(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg,
+System.Exception exc, System.Object[] out_args)
+
+Exception rethrown at [1]:
+
+in [0x00188] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:219)
+System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
+(System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg,
+System.Exception exc, System.Object[] out_args)--- End of inner
+exception stack trace ---
+
+in [0x0006b] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System.Reflection/MonoMethod.cs:353)
+System.Reflection.MonoCMethod:Invoke (System.Object obj, BindingFlags
+invokeAttr, System.Reflection.Binder binder, System.Object[]
+parameters, System.Globalization.CultureInfo culture)
+in [0x0011d] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System/Activator.cs:226)
+System.Activator:CreateInstance (System.Type type, BindingFlags
+bindingAttr, System.Reflection.Binder binder, System.Object[] args,
+System.Globalization.CultureInfo culture, System.Object[]
+activationAttributes)
+in [0x00030] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System/Activator.cs:149)
+System.Activator:CreateInstance (System.String assemblyName,
+System.String typeName, Boolean ignoreCase, BindingFlags bindingAttr,
+System.Reflection.Binder binder, System.Object[] args,
+System.Globalization.CultureInfo culture, System.Object[]
+activationAttributes, System.Security.Policy.Evidence securityInfo)
+in [0x00024] (at
+/tmp/scratch/BUILD/mono-1.1.14/mcs/class/corlib/System/Activator.cs:136)
+System.Activator:CreateInstance (System.String assemblyName,
+System.String typeName, System.Object[] activationAttributes)
+in [0x0004e] (at
+/home/diegoflorez84/Projects/BORRAME/Client/Client.cs:22)
+RemotingApp.Client:Main (System.String[] args)
+


More information about the mono-bugs mailing list