|
Hello,
I use MICO+CORBA::MICO to call (in perl
of course) some corba object implemented in java (JavaIDL ORB) under
sun solaris 8. So I only use the Interface Repository of MICO to connect to
JavaIDL Nameservice.
It was working very well ! But now i have to change to
solaris 9.
First I got problems to
install MICO on solaris9 doing compilation with standard options. Finally I
compiled MICO with this options :
./configure --prefix=/opt/mico --enable-intf-repo
--enable-minimum-corba
Next I start JavaIDL nameservice and MICO interface repository.. It run.
cool !
Now i'm trying to call one a ping() method i implemented on a component
named 'MY/COMP/NAME'. Here is my client program :
#!/bin/perl
use strict;
use warnings; use Data::Dumper; use Error qw(:try); use CORBA::MICO; my $ior;
my $ns_ior = "/tmp/nameservice.ior"; my $comp = "MY/COMP/NAME"; print "open $ns_ior\n";
if ( open( IOR_FILE, "<$ns_ior" ) ) { print "read $ns_ior\n"; $ior = <IOR_FILE>; close( IOR_FILE ); chomp($ior); unshift @ARGV, qw(-ORBInitRef
NameService=file:///tmp/nameservice.ior);
unshift @ARGV, qw(-ORBIfaceRepoIOR file:///tmp/ifacerepo.ior); print "ORB
init\n";
my $orb = CORBA::ORB_init( 'mico-local-orb' ); $orb->preload("IDL:omg.org/CosNaming/NamingContext:1.0"); $orb->preload("IDL:toto/tata/titi/MyProcessing:1.0"); print "get name
service\n";
my $nameService = $orb->string_to_object( $ior ); my $obj = $orb->string_to_object( $ior ); print Dumper($nameService); print "get ORB object
$comp\n";
my @pathName = split( '/', $comp ); my @name = (); for ( my $i=0; $i<scalar @pathName; $i++ ) { my $nameComponent = { id => $pathName[$i], kind => '' }; push @name, $nameComponent; } my $obj = $nameService->resolve( [EMAIL PROTECTED] ); print Dumper($obj); print "ping
component\n";
my $ret = $obj->ping(); print "return: $ret\n"; print "ok\n";
} else { print "erreur\n"; } print "end\n"; Here is the correct output on solaris 8
:
bash# perl client.pl
open /tmp/nameservice.ior
read /tmp/ifacerepo.ior ORB init get name service $VAR1 = bless( do{\(my $o = 2243968)}, '::CosNaming::NamingContext' ); get ORB object MY/COMP/NAME $VAR1 = bless( do{\(my $o = 2244288)}, '::toto/tata/titi/MyProcessing' ); ping component return: 1
ok
end
bash#
Here is the output of the client
program on the solaris 9: bash# perl client.pl
open /tmp/nameservice.ior read /tmp/ifacerepo.ior ORB init get name service $VAR1 = bless( do{\(my $o = 1684024)}, '::CosNaming::NamingContext' ); get ORB object MY/COMP/NAME $VAR1 = bless( do{\(my $o = 1684024)}, '::CosNaming::NamingContext' ); ping component Can't locate object method "ping" via package
"CosNaming::NamingContext" at client_mico_4_javaidl.pl line
72
bash# Then I tried to bless the return object to 'toto/tata/titi/MyProcessing' :
$obj = bless( $obj,
'toto::tata::titi::myProcessing');
I doesn't work...:
...
$VAR1 = bless( do{\(my $o = 1678048)}, '::CosNaming::NamingContext'
);
get ORB object MY/COMP/NAME $VAR1 = bless( do{\(my $o = 1678048)}, '::toto::tata::titi::myProcessing' ); ping component uncaught MICO exception: IDL:omg.org/CORBA/BAD_OPERATION:1.0 (0, maybe-completed) fin anormale (core dumped) bash# I conclude that the call to 'nameservice->resolve(..)' really
return the instance of nameservice, not the instance of my
component. Are compilation options ok for what i want to do ? Have someone any other
idea ??
Thanks for your help
Bruno
|
_______________________________________________ Mico-devel mailing list [email protected] http://www.mico.org/mailman/listinfo/mico-devel
