[orbitcpp-list] Problems with CosNaming. Does it work in ORBit-C++?
Status: Beta
Brought to you by:
philipd
|
From: Bang, S. <Ste...@ta...> - 2001-11-23 09:21:26
|
Platform: Intel PIII, RedHat linux 7.3, gcc 2.96,
ORBit 0.5.8, ORBit C++ 0.30.1
Has anyone successfully used the CosNaming stuff in
ORBit-C++?
I'm trying to get an application that works with
OmniORB 2.8 on a debian woody machine, up and running
on a RedHat 7.2 machine.
On the debian machine I tried different C++ ORBs (TAO, Mico,
ORBit/ORBit-C++, and OmniORB), so I have #ifdef
guards around ORB-specific things, and can make the
application compile with both ORBit and OmniORB.
I have compiled, but never run the application compiled
with ORBit on the debian machine. Earlier experiments
with a "Hello World" program showed that an ORBit client
attempting to access the OmniORB name server daemon,
would crash the daemon.
On the RedHat machine I have tried using the ORBit
name server, and it doesn't work. I'm listing the
code I'm using to initialize the ORB, and find the
name service (I'm starting the program with -ORBNamingIOR
option):
TPSCorbaInit::TPSCorbaInit(int& argc, char* argv[])
{
try {
// Initialize the ORB and the BOA (no POA yet)
m_orb = CORBA::ORB_init(argc, argv);
CORBA::Object_var tmpPOA =
m_orb->resolve_initial_references("RootPOA");
m_objectAdaptor = PortableServer::POA::_narrow(tmpPOA);
// CosNaming initialization
CORBA::Object_var tmp, tmp2;
tmp = m_orb->resolve_initial_references("NameService");
CosNaming::NamingContext_var namingContext =
CosNaming::NamingContext::_narrow(tmp);
CosNaming::Name appCtxName;
appCtxName.length(2);
appCtxName[0].id = "TandbergTV";
appCtxName[1].id = "somename";
CosNaming::NamingContext_var applicationContext;
try {
tmp2 = namingContext->resolve(appCtxName);
m_tandbergtvNC = CosNaming::NamingContext::_narrow(tmp2);
} catch (CosNaming::NamingContext::NotFound&) {
m_tandbergtvNC = namingContext->bind_new_context(appCtxName);
}
} catch(const CORBA::Exception&) {
cerr << argv[0] << ": TPSCorbaInit caught CORBA exception!" << endl;
} catch(...) {
cerr << argv[0] << ": TPSCorbaInit Caught non-CORBA exception!"
<< endl;
}
}
I've been running this code in gdb, and what seems to be
happening, is that
- the namingContext smart pointer gets a valid object
- the namingContext->resolve() call fails, and an
exception is thrown
- the exception is handled by the
catch (CosNaming::NamingContext::NotFound&)
clause
- the namingContext->bind_new_context() call fails,
and a new exception is thrown (I don't know which
yet. It is not a CORBA::SystemException, at least),
and the result is an m_tandbergtvNC with a null
object reference, which obviously isn't ideal
Do I need special privileges to call bind_new_context()
in the ORBit name server?
All hints, guesses, and clues are appreciated.
Thanx!
- Steinar
(In the meantime I'm working on getting OmniORB up
and running on the RedHat box. However, the only
OmniORB available as a source RPM is 3.0.4, which
is probably a very different creature from the 2.8
I've been using on debian.)
This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to
TANDBERG Television. If received in error please notify the sender and
destroy the original message and attachments.
|