Urban Purkat
2009-11-10 19:58:19 UTC
Hi!
I am working on openarchive project (http://www.openarchive.net/).
The product uses omniORB for its IPC library with connection to
omniNames service.
It currently uses "RootPOA" and it works fine for communication within
one openarchive system.
I would like to connect two systems. Therefore the first system needs to
connect to the second system's name service (NS2) to resolve objects.
Since omniORB does not allow me to have multiple orb instances this is
not doable.
I thought I can implement fixed references for some servants and resolve
objects from a predefined string.
In order to do that I introduced a secondary POA (omniINSPOA).
Here's a code snippet where I initialize omniORB:
m_orb = CORBA::ORB_init(a_argc, a_argv, s_orbName, options);
obj = m_orb->resolve_initial_references("RootPOA");
m_poa = PortableServer::POA::_narrow(obj);
// New code
obj = m_orb->resolve_initial_references("omniINSPOA");
m_poa2 = PortableServer::POA::_narrow(obj);
// New code end
obj = m_orb->resolve_initial_references("NameService");
m_rootContext = CosNaming::NamingContext::_narrow(obj);
After that I am ready to resolve objects from NS.
Note: The endPoint parameter is not set.
In management interface process (MIF) servant constructor I register to
naming service and additionally also activate servant using ID:
string objectName("mif");
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId(objectName.c_str());
m_poa2->activate_object_with_id(oid, this);
In order to be able to resolve this object from another process using a
fixed object name I need to set the endPoint parameter to
giop:tcp:ivd-test-01.topit.si:2809.
After I set it I cannot resolve any object using NS. But If I leave port
empty (giop:tcp:ivd-test-01.topit.si:) NS resolution is successful, but
I cannot narrow fixed object using the following code:
string objectUri = string("corbaloc:iiop:") + m_hostname +
string(":2809/mif");
CORBA::Object_var obj = m_orb->string_to_object(objectUri.c_str());
i_ManagementInterface_var mif = i_ManagementInterface::_narrow(obj);
Here's trace:
omniORB: Creating ref to remote: key<mif>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Invoke '_is_a' on remote: key<mif>
omniORB: Client attempt to connect to giop:tcp:ivd-test-01.topit.si:2809
omniORB: Name 'ivd-test-01.topit.si' resolved: 10.99.100.151
omniORB: Client opened connection to giop:tcp:10.99.100.151:2809
omniORB: sendChunk: to giop:tcp:10.99.100.151:2809 86 bytes
omniORB: inputMessage: from giop:tcp:10.99.100.151:2809 76 bytes
omniORB: throw OBJECT_NOT_EXIST from GIOP_C.cc:284
(NO,OBJECT_NOT_EXIST_NoMatch)
omniORB: throw OBJECT_NOT_EXIST from omniObjRef.cc:833
(NO,OBJECT_NOT_EXIST_NoMatch)
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
The omniORB configuration can be found at the end of mail.
Can both POAs be used together?
If no, do you have any other ideas how to connect to the other system?
I would really appreciate some help.
Regards,
Urban
Here's my configuration:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) = corbaloc:iiop:ivd-test-01.topit.si:2809
omniORB: InitRef = NameService=corbaname:iiop:ivd-test-01.topit.si:2809
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 172800000
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = localhost tcp
omniORB: clientTransportRule = 127.0.0.0/255.255.255.0 tcp
omniORB: clientTransportRule = * none
omniORB: configFile = C:\Program Files\GDS\IVD\etc\omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp:ivd-test-01.topit.si:
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 15
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 64
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 131072
omniORB: maxSocketSend = 131072
omniORB: nativeCharCodeSet = UTF-8
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 10
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 1
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = localhost tcp
omniORB: serverTransportRule = 127.0.0.0/255.255.255.0 tcp
omniORB: serverTransportRule = * none
omniORB: socketSendBuffer = 16384
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 1
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: validateUTF8 = 0
omniORB: verifyObjectExistsAndType = 1
I am working on openarchive project (http://www.openarchive.net/).
The product uses omniORB for its IPC library with connection to
omniNames service.
It currently uses "RootPOA" and it works fine for communication within
one openarchive system.
I would like to connect two systems. Therefore the first system needs to
connect to the second system's name service (NS2) to resolve objects.
Since omniORB does not allow me to have multiple orb instances this is
not doable.
I thought I can implement fixed references for some servants and resolve
objects from a predefined string.
In order to do that I introduced a secondary POA (omniINSPOA).
Here's a code snippet where I initialize omniORB:
m_orb = CORBA::ORB_init(a_argc, a_argv, s_orbName, options);
obj = m_orb->resolve_initial_references("RootPOA");
m_poa = PortableServer::POA::_narrow(obj);
// New code
obj = m_orb->resolve_initial_references("omniINSPOA");
m_poa2 = PortableServer::POA::_narrow(obj);
// New code end
obj = m_orb->resolve_initial_references("NameService");
m_rootContext = CosNaming::NamingContext::_narrow(obj);
After that I am ready to resolve objects from NS.
Note: The endPoint parameter is not set.
In management interface process (MIF) servant constructor I register to
naming service and additionally also activate servant using ID:
string objectName("mif");
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId(objectName.c_str());
m_poa2->activate_object_with_id(oid, this);
In order to be able to resolve this object from another process using a
fixed object name I need to set the endPoint parameter to
giop:tcp:ivd-test-01.topit.si:2809.
After I set it I cannot resolve any object using NS. But If I leave port
empty (giop:tcp:ivd-test-01.topit.si:) NS resolution is successful, but
I cannot narrow fixed object using the following code:
string objectUri = string("corbaloc:iiop:") + m_hostname +
string(":2809/mif");
CORBA::Object_var obj = m_orb->string_to_object(objectUri.c_str());
i_ManagementInterface_var mif = i_ManagementInterface::_narrow(obj);
Here's trace:
omniORB: Creating ref to remote: key<mif>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Invoke '_is_a' on remote: key<mif>
omniORB: Client attempt to connect to giop:tcp:ivd-test-01.topit.si:2809
omniORB: Name 'ivd-test-01.topit.si' resolved: 10.99.100.151
omniORB: Client opened connection to giop:tcp:10.99.100.151:2809
omniORB: sendChunk: to giop:tcp:10.99.100.151:2809 86 bytes
omniORB: inputMessage: from giop:tcp:10.99.100.151:2809 76 bytes
omniORB: throw OBJECT_NOT_EXIST from GIOP_C.cc:284
(NO,OBJECT_NOT_EXIST_NoMatch)
omniORB: throw OBJECT_NOT_EXIST from omniObjRef.cc:833
(NO,OBJECT_NOT_EXIST_NoMatch)
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
The omniORB configuration can be found at the end of mail.
Can both POAs be used together?
If no, do you have any other ideas how to connect to the other system?
I would really appreciate some help.
Regards,
Urban
Here's my configuration:
omniORB: DefaultInitRef (file) =
omniORB: DefaultInitRef (args) = corbaloc:iiop:ivd-test-01.topit.si:2809
omniORB: InitRef = NameService=corbaname:iiop:ivd-test-01.topit.si:2809
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 0
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 172800000
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = localhost tcp
omniORB: clientTransportRule = 127.0.0.0/255.255.255.0 tcp
omniORB: clientTransportRule = * none
omniORB: configFile = C:\Program Files\GDS\IVD\etc\omniORB.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp:ivd-test-01.topit.si:
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: immediateAddressSwitch = 0
omniORB: inConScanPeriod = 15
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 64
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 131072
omniORB: maxSocketSend = 131072
omniORB: nativeCharCodeSet = UTF-8
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 0
omniORB: oneCallPerConnection = 1
omniORB: outConScanPeriod = 10
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 1
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = localhost tcp
omniORB: serverTransportRule = 127.0.0.0/255.255.255.0 tcp
omniORB: serverTransportRule = * none
omniORB: socketSendBuffer = 16384
omniORB: strictIIOP = 1
omniORB: supportBootstrapAgent = 0
omniORB: supportCurrent = 1
omniORB: supportPerThreadTimeOut = 0
omniORB: tcAliasExpand = 0
omniORB: threadPerConnectionLowerLimit = 9000
omniORB: threadPerConnectionPolicy = 1
omniORB: threadPerConnectionUpperLimit = 10000
omniORB: threadPoolWatchConnection = 1
omniORB: traceExceptions = 1
omniORB: traceFile = [stderr]
omniORB: traceInvocationReturns = 0
omniORB: traceInvocations = 1
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: validateUTF8 = 0
omniORB: verifyObjectExistsAndType = 1