[omniORB] No connection to Naming Service from omniORB client
RKOSS@Opto22.com
RKOSS@Opto22.com
Mon Mar 3 18:58:01 2003
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2E1B6.8706C320
Content-Type: text/plain;
charset="iso-8859-1"
Hello all
Win2K, VC 6.0
I have my name service (Nokia name service, tnameserve.exe) running on
machine A and my client using omniORB running on machine B. I fail to
generate a NameContext object. I worry that I may be calling ORB_Init
incorrectly. Here are a few sections of code:
The following ORB_Init call does not generate any errors. If I subsequently
call list_initial_services() I will see "NameService" in the list therefore,
all appears to be good so far.
CORBA::ORB_var g_orb_var = CORBA::ORB::_nil();
omniORB::setLogFunction(omniTrace); // only for debugging
try{
int _argc = 3;
char * _argv[] = { "Orblib", "-ORBInitRef",
"NameService=corbaname:iiop:10.192.0.107:900", 0 };
const char* options[][2] = { { "traceLevel", "2" }, { 0, 0 } };
g_orb_var = CORBA::ORB_init(_argc, _argv, "omniORB4", options);
}
catch...
The following call to _narrow() generates a TRANSIENT exception.
try{
CORBA::Object_var obj_var =
g_orb_var->resolve_initial_references("NameService");
g_inc_var = CosNaming::NamingContext::_narrow(obj_var);
}
catch...
I sniff network communications because I expected to see the _narrow()
method make a TCP connection to the Naming Service, then send a GIOP
LocateRequest packet. But I don't even see the TCP connection attempt. This
leads me to believe that I didn't initialialize correctly. Maybe the ORB
doesn't know where the Name Service is?
A friend of mine created a client using jacorb and is connecting to the same
Naming Service. I'm sure I'm missing something very basic.
Do these sections of code look OK to you?
Thank you for your time
Ron Koss
rkoss@opto22.com
------_=_NextPart_001_01C2E1B6.8706C320
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>No connection to Naming Service from omniORB client</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Hello all</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Win2K, VC 6.0</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">I have my name service (Nokia name =
service, tnameserve.exe) running on machine A and my client using =
omniORB running on machine B. I fail to generate a NameContext object. =
I worry that I may be calling ORB_Init incorrectly. Here are a few =
sections of code:</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">The following ORB_Init call does not =
generate any errors. If I subsequently call list_initial_services() I =
will see "NameService" in the list therefore, all appears to =
be good so far.</FONT></P>
<P><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">CORBA::ORB_var =
g_orb_var =3D CORBA::ORB::_nil();</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 =
FACE=3D"Verdana">omniORB::setLogFunction(omniTrace); // only for =
debugging</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">try{</FONT>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">int _argc =3D 3;</FONT>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">char * _argv[] =3D { "Orblib", =
"-ORBInitRef", =
"NameService=3Dcorbaname:iiop:10.192.0.107:900", 0 };</FONT>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">const char* options[][2] =3D { { =
"traceLevel", "2" }, { 0, 0 } };</FONT>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">g_orb_var =3D CORBA::ORB_init(_argc, _argv, =
"omniORB4", options);</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">}</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">catch...</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">The following call to _narrow() =
generates a TRANSIENT exception.</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">try{</FONT>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">CORBA::Object_var obj_var =3D =
g_orb_var->resolve_initial_references("NameService");</FONT=
>
<BR> <FONT COLOR=3D"#008000" =
SIZE=3D2 FACE=3D"Verdana">g_inc_var =3D =
CosNaming::NamingContext::_narrow(obj_var);</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">}</FONT>
<BR><FONT COLOR=3D"#008000" SIZE=3D2 FACE=3D"Verdana">catch...</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">I sniff network communications =
because I expected to see the _narrow() method make a TCP connection to =
the Naming Service, then send a GIOP LocateRequest packet. But I don't =
even see the TCP connection attempt. This leads me to believe that I =
didn't initialialize correctly. Maybe the ORB doesn't know where the =
Name Service is?</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">A friend of mine created a client =
using jacorb and is connecting to the same Naming Service. I'm sure I'm =
missing something very basic.</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Do these sections of code look OK to =
you?</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Thank you for your time</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Verdana">Ron Koss</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Verdana">rkoss@opto22.com</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C2E1B6.8706C320--