您好:
Hello, I am developing a distributed application using CORBA.
My client application in aix 5.2.0.0 works properly when the server application is up . The server application run on windows.
If the server is down, then run the client app and get the following:
"
uncaught MICO exception: IDL:omg.org/CORBA/COMM_FAILURE:1.0
(0, not-completed)
IOT/Abort trap(coredump)
"
In my prougramm the functions is :
int
lookup()
{
// ORB initialization
CORBA::ORB_var orb = CORBA::ORB_init(num,
opt);
// Acquire a reference
to the Naming Service
CORBA::Object_var nsobj
= orb->resolve_initial_references("NameService");
CosNaming::NamingContext_var
nc = CosNaming::NamingContext::_narrow(nsobj);
if(CORBA::is_nil(nc))
{
cerr <<
"oops, I cannot access the Naming Service!" << endl;
return(-1);
}
// Construct Naming Service
name
CosNaming::Name name;
name.length(1);
name[0].id = CORBA::string_dup("upSendMsg");
// "upSendMsg" is the name of Naming Service
name[0].kind = CORBA::string_dup("");
// try to find that node
in the Naming Service tree
CORBA::Object_var obj;
#ifdef HAVE_EXCEPTIONS
try
{
obj = nc->resolve(name);
}
catch(CosNaming::NamingContext::NotFound
&exc)
{
cout <<
"NotFound exception." << endl;
return(-1);
}
catch(CosNaming::NamingContext::CannotProceed
&exc)
{
cout <<
"CannotProceed exception." << endl;
return(-1);
}
catch (CosNaming::NamingContext::InvalidName
&exc)
{
cout <<
"InvalidName exception." << endl;
return(-1);
}
catch (CosNaming::NamingContext::AlreadyBound
&exc)
{
cout <<
"AlreadyBound exception." << endl;
return(-1);
}
catch (CosNaming::NamingContext::NotEmpty
&exc)
{
cout <<
"NotEmpty exception." << endl;
return(-1);
}
catch (...)
{
cerr <<
"Cannot find EventChannel !" << endl;
cout <<
"Cannot find EventChannel !" << endl;
return(-1);
}
#else
obj = nc->resolve(name);
wcout<<"here
is "<<endl;
#endif
wcout<<"here
is "<<endl;
// The Naming Service
returns a generic reference as a CORBA::Object
// We need to narrow this
to the desired type
up = UpSendMsgInterface::_narrow(obj);
return( 0 );
}
================================================================================
My question is why the client can not
catch exception when the server is not up .
Cause I must do other things when
the server is not up.
Thank you in advance and friendly greetings.
I so hope you can help me as soon as
you can. :)
祝工作顺利!
致
礼!
临时联系电话: 010-58856600-2102
=========================
广西分支 陈玉林
北京神州数码思特奇信息技术股份有限公司
telephone:0771-5566649
mobile:13077769671
�q⌒�r┅~ ¤ �q⌒�r �q⌒�r
�q⌒�q⌒�r�q⌒�r~�q⌒�r�幡�, �幡�
,�幡幡幡�,''��~~ ,''~�幡帷� ,''
�p �u�����������p�p�p�p�p�p�p�p�p�p�p
�p �蛱铴蛱� 田 �颉 � �p
_______________________________________________ Mico-devel mailing list [email protected] http://www.mico.org/mailman/listinfo/mico-devel
