Hello,
I am new to Corba Orbix C++. I am working on a small project to get
accquaintance with Corba Client Server 3.3 on Sun systems. When I try
binding name and object, I get into trouble with bind_new_context on the
server.cxx.
....
#include <Namingservice.hh>
int main(argc, argv)
{
CORBA::Object_var orb = CORBA::ORB::_init(argc,argv,"Orbix"
;
CORBA::Object_var boa = CORBA::BOA::_init(argc,argv,"Orbix_BOA"
;
CORBA::Object_var name_service=
CORBA::ORB::resolve_inital_reference("NameService"
;
CosNaming::NamingContext_var root_context =
CosNaming::NamingContext::_narrow(name_service);
CosNaming::Name_var name= new CosNaming::Name(1);
name->length( 1 );
name[0].id = CORBA::string_dup("Hello"
;
name[0].kind = CORBA::string_dup(""
;
try
{
CosNaming::NamingContext_var next_context =
root_context->bind_new_context(name);
}catch(CosNaming::NamingContext::AlreadyBound &ex) {
cerr << "AlreadyBound...." << endl;
......code to rebind...
}
}
When I run the server*, bind_new_context fail but error is not trapped in
the 'AlreadyBound'. So I change the code to catch with SystemException:
catch(CORBA::SystemException &ex) {
cerr << "Error : " << ex << endl;
......code to rebind...
}
then the error comes out like this:
Error: 12000 -- Unknown Error Code : 12003
Anyone knows what the problem is, please let me know.
Thanks,
Don N
Please write to me at : dononeness@netscape.net
I am new to Corba Orbix C++. I am working on a small project to get
accquaintance with Corba Client Server 3.3 on Sun systems. When I try
binding name and object, I get into trouble with bind_new_context on the
server.cxx.
....
#include <Namingservice.hh>
int main(argc, argv)
{
CORBA::Object_var orb = CORBA::ORB::_init(argc,argv,"Orbix"
CORBA::Object_var boa = CORBA::BOA::_init(argc,argv,"Orbix_BOA"
CORBA::Object_var name_service=
CORBA::ORB::resolve_inital_reference("NameService"
CosNaming::NamingContext_var root_context =
CosNaming::NamingContext::_narrow(name_service);
CosNaming::Name_var name= new CosNaming::Name(1);
name->length( 1 );
name[0].id = CORBA::string_dup("Hello"
name[0].kind = CORBA::string_dup(""
try
{
CosNaming::NamingContext_var next_context =
root_context->bind_new_context(name);
}catch(CosNaming::NamingContext::AlreadyBound &ex) {
cerr << "AlreadyBound...." << endl;
......code to rebind...
}
}
When I run the server*, bind_new_context fail but error is not trapped in
the 'AlreadyBound'. So I change the code to catch with SystemException:
catch(CORBA::SystemException &ex) {
cerr << "Error : " << ex << endl;
......code to rebind...
}
then the error comes out like this:
Error: 12000 -- Unknown Error Code : 12003
Anyone knows what the problem is, please let me know.
Thanks,
Don N
Please write to me at : dononeness@netscape.net