[Ace-users] Re: [tao-users] Naming Service problem
Johnny Willemsen
jwillemsen at remedy.nl
Tue Sep 25 06:12:51 CDT 2007
Hi,
The WellWisher is a naming context, you have to create that first using
bind_context.
Regards,
Johnny Willemsen
Remedy IT
Postbus 101
2650 AC Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl <http://scoreboard.theaceorb.nl/> ***
*** Commercial service and support for ACE/TAO/CIAO ***
*** See http://www.theaceorb.nl/en/support.html ***
________________________________
From: dhanya v [mailto:vishnu.dhanya at gmail.com]
Sent: Tuesday, September 25, 2007 12:48 PM
To: Johnny Willemsen
Subject: Re: Naming Service problem
Hi Willemsen,
Thanks for replying.
My code is as following:
//Creating CORBA object
hello_HelloInterface_i* helloImpl = new hello_HelloInterface_i();
hello::HelloInterface_var hello = helloImpl -> _this();
//Resolved Name Service
CORBA::Object_var naming_context_object =
orb->resolve_initial_references ("NameService");
CosNaming::NamingContext_var root_context =
CosNaming::NamingContext::_narrow (naming_context_object.in ());
//Creating Name space
CosNaming::Name name (2);
name->length (2);
name[0].id = CORBA::string_dup ("WellWisher");
name[1].id = CORBA::string_dup ("Hello");
cout<<"\tBinding Name with NamingService"<<endl;
root_context->rebind (name, hello.in());
and this fails with the exception
NotFound (IDL:omg.org/CosNaming/NamingContext/NotFound:1.0)
What do you mean by creating WellWisher context in advance?
regards,
Dhanya
On 9/25/07, Johnny Willemsen <jwillemsen at remedy.nl> wrote:
Hi,
This will only work if you have created the WellWisher
context in advance,
you can't create new contexts as apart of the bind.
Regards,
Johnny Willemsen
Remedy IT
Postbus 101
2650 AC Berkel en Rodenrijs
The Netherlands
www.theaceorb.nl / www.remedy.nl
*** Integrated compile and test statistics see
http://scoreboard.theaceorb.nl ***
*** Commercial service and support for ACE/TAO/CIAO
***
*** See http://www.theaceorb.nl/en/support.html
***
<vishnu.dhanya at gmail.com> wrote in message
news:<
1190224675.526887.173440 at e34g2000pro.googlegroups.com>...
> ACE VERSION: 5.5.8
>
> HOST MACHINE and OPERATING SYSTEM: Windows 2000 &
Vista
>
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU
FILE [if you
> use a link to a platform-specific file, simply state
which one
> (unless this isn't used in this case, e.g., with
Microsoft Visual
> C++)]:
>
>
>
> AREA/CLASS/EXAMPLE AFFECTED:
> CORBA Naming Service
>
>
> DOES THE PROBLEM AFFECT:
> COMPILATION? No
> LINKING? No
> EXECUTION? YES
> OTHER (please specify)?
>
>
> SYNOPSIS:
> [Brief description of the problem]
>
> If I try to create a Name in Naming Service, and set its
length more
> than 1 I get exception.
>
> DESCRIPTION:
>
> I am trying to create a Name of length 2. (more than 1).
it compiles
> and links well, but fails at execution time with the
following
> exception when bind or rebind is called.
> NotFound
(IDL:omg.org/CosNaming/NamingContext/NotFound:1.0)
>
> REPEAT BY:
> CORBA::Object_var naming_context_object = orb-
> >resolve_initial_references ("NameService");
> CosNaming::NamingContext_var root_context =
> CosNaming::NamingContext::_narrow
(naming_context_object.in ());
>
> cout<<"\n\tRegistering HelloInterface object with
> NamingService"<<endl;
> CosNaming::Name name;// = new CosNaming::Name ();
> name.length (2);
>
> name[0].id = CORBA::string_dup ("WellWisher");
> name[1].id = CORBA::string_dup ("Hello");
>
> root_context->bind (name, hello.in ());
>
>
>
> It should be possible to create a Name of length more than
1 right?
>
> regards,
> Vishnu
>
More information about the Ace-users
mailing list