Re: binding to nameserver problem



Hi

In the IDL list, you need to include CosNaming.idl as well (ie. not
just echo.idl) . It's available in src/services under the base dir. of
ORBit.

Sreeji
On Fri, 24 Aug 2001, Nohl Attila Rajmund wrote:

> Hello!
> 
> I have a problem with the CORBA::ORBit perl module on RedHat 7.1.
> I try to bind my server application to the nameserver but it does not
> work. This is my code:
> 
> echo.idl:
> module EchoModule {
>         interface Echo {
>                 string echoString(in string input);
>         };
> };
> 
> 
> echo-server2.pl:
> use strict;
> use CORBA::ORBit idl => [ qw(echo.idl) ];
> 
> package MyEchoServer;
> 
> @MyEchoServer::ISA = qw(POA_EchoModule::Echo);
> 
> sub new {
>         my $self = bless {
>         };
> }
> 
> sub echoString {
>         my ($self, $input)= _;
>         printf("Got:%s\n",$input);
>         return $input;
> }
> 
> my $orb = CORBA::ORB_init(@ARGV,"orbit-name-server");
> my $poa = $orb->resolve_initial_references("RootPOA");
> my $servant = new MyEchoServer;
> my $id = $poa->activate_object ($servant);
> 
> open (IN, "<ns.ior");
> chomp(my $ior=<IN>);
> close IN;
> 
> my $ns=$orb->string_to_object($ior);
> 
> (my $bl, my $bi) = $ns->list(15);
> print $bl;
> print $bi;
> 
> $ns->bind(
>         [{'id' => 'echo2-server' , 'kind' => 'server'}],
>         $poa->servant_to_reference ($servant)
>         );
> 
> 
> $poa->_get_the_POAManager->activate;
> 
> $orb->run ();
> 
> 
> When I start the server (after I put the IOR of the nameserver into
> ns.ior with the "orbit-name-server >ns.ior" command) I got the following
> error:
> autoloading list
> Can't get interface
>  at echo2-server.pl line 31
> 
> Can you tell me how can I bind to the name server (or just point me to
> some example codes that show this)?
> 
>                                 Bye,NAR
> -- 
> "Beware of bugs in the above code; I have only proved it correct, not
>  tried it."
> 
> 
> 
> _______________________________________________
> orbit-perl-list mailing list
> orbit-perl-list gnome org
> http://mail.gnome.org/mailman/listinfo/orbit-perl-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]