Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NamingService Unknown Error

Status
Not open for further replies.

don999

Programmer
Joined
May 24, 2002
Messages
1
Location
US
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,&quot;Orbix&quot;);
CORBA::Object_var boa = CORBA::BOA::_init(argc,argv,&quot;Orbix_BOA&quot;);

CORBA::Object_var name_service=

CORBA::ORB::resolve_inital_reference(&quot;NameService&quot;);
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(&quot;Hello&quot;);
name[0].kind = CORBA::string_dup(&quot;&quot;);

try
{
CosNaming::NamingContext_var next_context =
root_context->bind_new_context(name);
}catch(CosNaming::NamingContext::AlreadyBound &ex) {
cerr << &quot;AlreadyBound....&quot; << 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 << &quot;Error : &quot; << 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top