[omniORB] LocateRequest against OrbixWeb fails when object really does exis
t?
Mark Elder
MarkElder@Martin-Group.com
Thu, 6 Sep 2001 09:33:47 -0500
Hello,
I am using OmniOrb 3.03 to connect to OrbixWeb. This is your black box
setup where I don't have any control over the Orbix end. By the way can
anyone tell me how to figure out what version of Orbix that I am running
against - the system administrator on the other end does not know - it is
running on a Solaris machine.
Anyway I thought I had things working and something unknown changed that is
causing me huge problems. The server has a published IOR file that I access
via FTP to get a Connection Factory object. This object has a single
create_connection method. When I make the call I get a OBJECT_NOT_EXIST
error. However, this used to work without any error. It looks like the
error is actually being thrown by a call to LocateRequest - and I have
stepped into the code and verified this. Here is the trace that pointed me
in that direction:
omniORB: scavenger : scanning connections
omniORB: Activating: root<0>
omniORB: scavenger : scanning connections
omniORB: Creating ref to local: root<0>
target id : IDL:QCmaApi/Connection:1.0
most derived id: IDL:QCmaApi/Connection:1.0
omniORB: createObjRef -- reusing reference from local ref list.
omniORB: LocateRequest to remote:
key<0x3a5c3139322e3136382e352e32353a2d3838393234313630343a436f6e6e656374696f
6e466163746f72793a3a4946523a51436d614170695f436f6e6e656374696f6e466163746f72
7900>
omniORB: throw OBJECT_NOT_EXIST from remoteIdentity.cc:231
omniORB: omniRemoteIdentity deleted.
omniORB: strand Rope::decrRefCount: old value = 1
omniORB: ObjRef(IDL:QCmaApi/ConnectionFactory:1.0) -- deleted.
omniORB: scavenger : scanning connections
omniORB: strand Rope_iterator: delete unused Rope.
Here is the really strange thing - just to see what would happen I skipped
the line in remoteIdentity that was throwing the error (making it seem like
the server returned GIOP::OBJECT_HERE) and the call succeeded! Continuing
further the next call to LocateRequest (on the returned object) succeeded
the first time without me having to skip the throw. I am at a loss as to
what could have changed in my code or on the server to cause this. I was
running at 8:00 one night and with a server reboot overnight my code was
broke the next morning.
Right now to get back up and testing I have added these two lines:
factory->_remote_non_existent();
factory->_noExistentCheck();
I initially tried just the _noExistentCheck call but then OmniOrb seemed to
think that the object was local. Making both calls seems to work for now.
Naturally I would like to find a better answer than this but I am at a loss
of how/where to proceed. On the server side I am working with a sys admin
that can get me trace files and restart the service but I don't even know
what to ask for - this is my first CORBA project and OmniOrb is the only Orb
I have used.
Below is the code where I am resolving the IOR and getting my connection.
Thanks in advance!
Mark
----------------------------------------------------------------------------
---
if (CORBA::is_nil(g_orb))
{
m_cMAError.ThrowComError(-1, "The Orb is NIL. The Orb should have
been created by StartOperation");
}
CORBA::Object_var obj = g_orb->string_to_object(sm_IOR);
QCmaApi::ConnectionFactory_var factory =
QCmaApi::ConnectionFactory::_narrow(obj);
if( CORBA::is_nil(factory) )
m_cMAError.ThrowComError(-1, "Could not get a Connection Factory
Object.");
obj = g_orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
CallbackConnection_i* connection = new
CallbackConnection_i(sm_pWriteMQ);
PortableServer::ObjectId_var myId = poa->activate_object(connection);
connection->_remove_ref();
PortableServer::POAManager_var pman = poa->the_POAManager();
pman->activate();
// Should not be needed but gets around a OBJECT_NOT_EXIST error
factory->_remote_non_existent();
factory->_noExistentCheck();
obj = factory->create_connection(sm_UserName, sm_Password,
QCmaApi::GUARANTEED_DELIVERY,
connection->_this());
m_connection = QCServiceMA::ConnectionValidation::_narrow(obj);
if( CORBA::is_nil(m_connection) )
m_cMAError.ThrowComError(-1, "Could not get a Connection Object.");
m_connection->is_alive();