Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem: org.omg.CosNaming.NamingContextPackage.NotFound

79 views
Skip to first unread message

Teresa Redmond

unread,
Jul 24, 2001, 3:19:58 PM7/24/01
to
Hi, all:

I am developing a CORBA client/server using JDK 1.3.1 and testing using
tnameserv, just like the tutorial. I was able to get my client/server
working a few weeks ago, but in adding some function calls that weren't
there then, I'm now getting the error in the subject line. I don't have any
idea what to do, and am not finding a lot of help on the internet or the
Java web site. If anyone has any ideas, please let me know, many thanks!

Here is the error message:

org.omg.CosNaming.NamingContextPackage.NotFound
org.omg.CosNaming.NamingContextPackage.NotFound
at
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(Unknown Source)
at
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.extract(Unknown
Source)
at org.omg.CosNaming._NamingContextStub.resolve(Unknown Source)
at servlet.CatalogQueryClient.main(CatalogQueryClient.java:44)

and here is my code, inside servlet.CatalogQueryClient.main:

/**
* @Set up the CORBA name space for incoming calls
*/

// create ORB
ORB orb = ORB.init (args, null);
//client will use Naming Service
org.omg.CORBA.Object o1 = null;
try {
o1 = orb.resolve_initial_references("NameService");
}catch (Exception e) {}
NamingContext ncRef = NamingContextHelper.narrow (o1);

// Resolve the object reference in naming
NameComponent nc = new NameComponent("RequestQuery", "");
NameComponent path[] = {nc};
RequestQuery catalogRef = null;
try {
// I added the entire package structure in the next line to see if that
would help, and it didn't...
// it's the next line where the error happens.
catalogRef =
servlet.QueryApp.RequestQueryHelper.narrow(ncRef.resolve(path));
} catch (Exception e) {
System.out.println("Error at line 62");
System.out.println(e);
e.printStackTrace();
}

--
~teresa redmond~
Anteon Corporation
tred...@anteon.com


Teresa Redmond

unread,
Jul 24, 2001, 3:27:31 PM7/24/01
to
"Teresa Redmond" <pixe...@yahoo.com> wrote in message
news:9jkhm1$ofr29$1...@ID-96329.news.dfncis.de...

> Hi, all:
>
> I am developing a CORBA client/server using JDK 1.3.1 and testing using
> tnameserv, just like the tutorial. I was able to get my client/server
> working a few weeks ago, but in adding some function calls that weren't
> there then, I'm now getting the error in the subject line. I don't have
any
> idea what to do, and am not finding a lot of help on the internet or the
> Java web site. If anyone has any ideas, please let me know, many thanks!
>
> Here is the error message:
>
> org.omg.CosNaming.NamingContextPackage.NotFound
> org.omg.CosNaming.NamingContextPackage.NotFound
> at
> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(Unknown Source)
> at
> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.extract(Unknown
> Source)
> at org.omg.CosNaming._NamingContextStub.resolve(Unknown Source)
> at servlet.CatalogQueryClient.main(CatalogQueryClient.java:44)
>
> and here is my code, inside servlet.CatalogQueryClient.main:
>
> /**
> * @Set up the CORBA name space for incoming calls
> */
>
> // create ORB
> ORB orb = ORB.init (args, null);
> file://client will use Naming Service

This ^^^ was added somewhere, the string "file:" does *not* appear in my
code here... it's supposed to be a commented line saying the client will
use the naming service.

> org.omg.CORBA.Object o1 = null;
> try {
> o1 = orb.resolve_initial_references("NameService");
> }catch (Exception e) {}
> NamingContext ncRef = NamingContextHelper.narrow (o1);
>
> // Resolve the object reference in naming
> NameComponent nc = new NameComponent("RequestQuery", "");
> NameComponent path[] = {nc};
> RequestQuery catalogRef = null;
> try {
> // I added the entire package structure in the next line to see if
that
> would help, and it didn't...
> // it's the next line where the error happens.
> catalogRef =
> servlet.QueryApp.RequestQueryHelper.narrow(ncRef.resolve(path));
> } catch (Exception e) {
> System.out.println("Error at line 62");
> System.out.println(e);
> e.printStackTrace();
> }
>

Sorry for any confusion...

Stephen Crawley

unread,
Jul 24, 2001, 9:43:24 PM7/24/01
to
"Teresa Redmond" <pixe...@yahoo.com> writes:

> I am developing a CORBA client/server using JDK 1.3.1 and testing using
> tnameserv, just like the tutorial. I was able to get my client/server
> working a few weeks ago, but in adding some function calls that weren't
> there then, I'm now getting the error in the subject line. I don't have any
> idea what to do, and am not finding a lot of help on the internet or the
> Java web site. If anyone has any ideas, please let me know, many thanks!

The most likely cause of the NotFound exception is that the entry you
are tying to resolve is not in the context. Check that the code that
is inserting it is using the right name, the right context, and that
it is not failing.

-- Steve

Teresa Redmond

unread,
Jul 26, 2001, 10:39:18 AM7/26/01
to
"Stephen Crawley" <cra...@dstc.edu.au> wrote in message
news:dchew1e...@soluble.dstc.edu.au...

I hate to be dense, but as a newbie (I should have said that from the
start), I'm not sure what you mean by "entry"? I tried importing all the
way to all the files that idlj had made, but that didn't work, and since I
don't know what "context" is either, it's very frustrating. I have yet to
find a step by step tutorial on writing CORBA other than Hello World, which
takes no parameters, or a few others on java.com which also take no
parameters, and which don't really explain the terms you use. I am also
really strapped for cash, so can't go buy any books.

In the idl, I have the interface name as "RequestQuery", and in the server
code it's the same, and in the client code, and it's the client code that
has the error. Thanks for any further help!

--
~teresa~

^..^ "Never try to outstubborn a cat." Robert A. Heinlein ^..^
http://www.heinleinsociety.org/ &
http://hometown.aol.com/pixelmeow/index.htm
"Blert!" quoth Pixel, a small, yellow cat.

Teresa Redmond

unread,
Jul 27, 2001, 5:36:57 PM7/27/01
to
Sorry to send this again, but I really need to know how I can solve this
problem. I'm also not seeing any posts on the server, for a whole 24 hours
now, so I want to test my connection...

Really sorry to be a bother, guys. Thanks.

--
Teresa Redmond
Associate Software Engineer
Anteon Corporation
tred...@anteon.com

"Teresa Redmond" <pixe...@yahoo.com> wrote in message news:...
> Hi, all:


>
> I am developing a CORBA client/server using JDK 1.3.1 and testing using
> tnameserv, just like the tutorial. I was able to get my client/server
> working a few weeks ago, but in adding some function calls that weren't
> there then, I'm now getting the error in the subject line. I don't have
any
> idea what to do, and am not finding a lot of help on the internet or the
> Java web site. If anyone has any ideas, please let me know, many thanks!
>

> Here is the error message:
>
> org.omg.CosNaming.NamingContextPackage.NotFound
> org.omg.CosNaming.NamingContextPackage.NotFound
> at
> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(Unknown Source)
> at
> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.extract(Unknown
> Source)
> at org.omg.CosNaming._NamingContextStub.resolve(Unknown Source)
> at servlet.CatalogQueryClient.main(CatalogQueryClient.java:44)
>
> and here is my code, inside servlet.CatalogQueryClient.main:
>
> /**
> * @Set up the CORBA name space for incoming calls
> */
>
> // create ORB
> ORB orb = ORB.init (args, null);

> ///client will use Naming Service


> org.omg.CORBA.Object o1 = null;
> try {
> o1 = orb.resolve_initial_references("NameService");
> }catch (Exception e) {}
> NamingContext ncRef = NamingContextHelper.narrow (o1);
>
> // Resolve the object reference in naming

///"RequestQuery" matches the interface in the IDL, but I don't know
if that's the problem...


> NameComponent nc = new NameComponent("RequestQuery", "");
> NameComponent path[] = {nc};
> RequestQuery catalogRef = null;
> try {
> // I added the entire package structure in the next line to see if
that
> would help, and it didn't...
> // it's the next line where the error happens.
> catalogRef =
> servlet.QueryApp.RequestQueryHelper.narrow(ncRef.resolve(path));
> } catch (Exception e) {
> System.out.println("Error at line 62");
> System.out.println(e);
> e.printStackTrace();
> }
>

Gerald Brose

unread,
Jul 28, 2001, 4:48:06 AM7/28/01
to

Teresa Redmond wrote:
>
> "Stephen Crawley" <cra...@dstc.edu.au> wrote in message
> news:dchew1e...@soluble.dstc.edu.au...
> > "Teresa Redmond" <pixe...@yahoo.com> writes:
> >
> > > I am developing a CORBA client/server using JDK 1.3.1 and testing using
> > > tnameserv, just like the tutorial. I was able to get my client/server
> > > working a few weeks ago, but in adding some function calls that weren't
> > > there then, I'm now getting the error in the subject line. I don't have
> any
> > > idea what to do, and am not finding a lot of help on the internet or the
> > > Java web site. If anyone has any ideas, please let me know, many
> thanks!
> >
> > The most likely cause of the NotFound exception is that the entry you
> > are tying to resolve is not in the context. Check that the code that
> > is inserting it is using the right name, the right context, and that
> > it is not failing.
> >
>
> I hate to be dense, but as a newbie (I should have said that from the
> start), I'm not sure what you mean by "entry"? I tried importing all the
> way to all the files that idlj had made, but that didn't work, and since I
> don't know what "context" is either, it's very frustrating.

Your CORBA server must have bound a name to a CORBA object
reference using the bind() operation of the NamingContext interface.
A context contains bindings, i.e., pairs (name, reference).
Using resolve(name) you can retrieve the reference bound to it
in that context. Stephen was referring to a binding when he
wrote "entry".

Either you did not start the server in time to have it bind the
name your client is trying to resolve, or your server does not
use the same naming context as your client. (BTW, contexts can
be nested, much like directories in a file system, so naming
contexts graphs can be created.)

> I have yet to
> find a step by step tutorial on writing CORBA other than Hello World, which
> takes no parameters, or a few others on java.com which also take no
> parameters, and which don't really explain the terms you use. I am also
> really strapped for cash, so can't go buy any books.

For more detailed information you can read the specs. (they
are concise and free :-)) or look at the examples that come
with the various ORBs. I would still recommend to invest in
one or two good books. For Java, the most comprehensive and
up-to-date book is our own (Brose, Vogel, Duddy, "Java Programming
with CORBA", Wiley 2001), for C++ the Henning&Vinoski book is
a must.

Regards and good luck, Gerald Brose.
--
Gerald Brose Institut fuer Informatik
gerald...@acm.org Freie Universitaet Berlin
http://www.inf.fu-berlin.de/~brose Takustrasse 9
Phone: (++49 30) 838 75 112 Germany

Teresa Redmond

unread,
Jul 29, 2001, 4:16:30 PM7/29/01
to

"Gerald Brose" <br...@inf.fu-berlin.de> wrote in message
news:3B627C46...@inf.fu-berlin.de...

Thanks for the info, I will check this out in just a few minutes.

> > I have yet to
> > find a step by step tutorial on writing CORBA other than Hello World,
which
> > takes no parameters, or a few others on java.com which also take no
> > parameters, and which don't really explain the terms you use. I am also
> > really strapped for cash, so can't go buy any books.
>
> For more detailed information you can read the specs. (they
> are concise and free :-)) or look at the examples that come
> with the various ORBs. I would still recommend to invest in
> one or two good books. For Java, the most comprehensive and
> up-to-date book is our own (Brose, Vogel, Duddy, "Java Programming
> with CORBA", Wiley 2001), for C++ the Henning&Vinoski book is
> a must.
>
> Regards and good luck, Gerald Brose.

Thanks very much, I will see about getting your book, in a week or so... I
haven't done anything with C++ yet, one thing at a time... :-)

0 new messages