[Mono-dev] Problems with remoting in recent svn, about revision 81700 - 81724
Mads Bondo Dydensborg
mbd at dbc.dk
Wed Jul 11 18:29:55 EDT 2007
Hi there
I should probably file a bug for this problem, but it appears in so recent
svn, I was hoping that one of the recent submitters might be interessted in
resolving this issue.
The attached program works as you would expect with svn rev 81700 (and older),
but is broken[1] with svn from last night (UTC - about 24 hours ago right
now). I have speent quite a bit of time (to put it mildly, mono takes a loong
time to update and compile over here :-) trying to pinpoint the exact
revision where the program starts to fail, but has not had complete success,
mostly because a number of the revisions in the span, does not really compile
1.2.4: OK
81413: OK
81600: OK
81700: OK
81713: mcs compilation error, stuff that gets installed(?) appears to work
81715: mcs compilation error, stuff that gets installed(?) does not work
81724: mcs compilation error, stuff that gets installed(?) does not work
81740: Not OK
I am quite uncertain about 81713, 81715 and 81724 due to the partial compiles
(of mcs), but quite certain on the others.
[1] The problem appears as
Unhandled Exception: System.NullReferenceException: Object reference not set
to an instance of an object
at System.Runtime.Remoting.RemotingServices.GetOrCreateClientIdentity
(System.Runtime.Remoting.ObjRef objRef, System.Type proxyType, System.Object&
clientProxy) [0x000e8]
in /home/compile/Compile/Mono/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:653
at System.Runtime.Remoting.RemotingServices.GetRemoteObject
(System.Runtime.Remoting.ObjRef objRef, System.Type proxyType) [0x00000]
in /home/compile/Compile/Mono/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:729
at System.Runtime.Remoting.RemotingServices.Connect (System.Type
classToProxy, System.String url) [0x00009]
in /home/compile/Compile/Mono/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:180
at System.Activator.GetObject (System.Type type, System.String url)
[0x00012]
in /home/compile/Compile/Mono/mcs/class/corlib/System/Activator.cs:293
at RemotingProblem.Main (System.String[] args) [0x00078]
in /home/madsdyd/xintegra/trunk/tests/RemotingProblem.cs:41
- when running the program as a client.
A normal run, produces this output:
Connected
server.Hello() = 'Hello World!'
For other reasons, I can not run my program with 1.2.4 succesfully at the
moment (some issue with the XmlValidation), so getting this issue resolved
would be great.
Regards,
Mads
--
Med venlig hilsen/Regards
Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 34
-------------- next part --------------
// Demonstrate remoting problem
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
interface IHello {
string Hello();
}
public class CHello : MarshalByRefObject, IHello {
public string Hello() {
return "Hello World!";
}
}
class RemotingProblem {
static public void Main( string[] args ) {
if ( args.Length != 1 ) {
Console.WriteLine( "Usage: RemotingProblem <server|client>" );
return;
}
if ( args[0] == "server" ) {
// server
TcpChannel chan = new TcpChannel( 12345 );
ChannelServices.RegisterChannel( chan );
RemotingConfiguration
.RegisterWellKnownServiceType( typeof( CHello ),
"Subject",
WellKnownObjectMode.Singleton );
Console.WriteLine( "Server starter on localhost:12345/Subject" );
Console.WriteLine( "To exit, press enter" );
Console.ReadLine();
} else {
// client
TcpChannel chan = new TcpChannel(0);
ChannelServices.RegisterChannel( chan );
IHello server
= ( IHello )
Activator
.GetObject( typeof( IHello ),
"tcp://localhost:12345/Subject" );
if ( server == null ) {
Console.WriteLine( "Could not connect to server" );
return;
} else {
Console.WriteLine( "Connected" );
Console.WriteLine( "server.Hello() = '{0}'", server.Hello() );
}
}
}
}
More information about the Mono-devel-list
mailing list