[omniORB] [help] [beginner] cannot run naming service examples from python chapter 2 "The Basics"

Alistair Bayley alistair at abayley.org
Thu Aug 25 11:41:44 BST 2011


>> omniNames is configured in a fishy way:
>>
>> It is publishing endpoints localhost:2808 and 172.30.135.150:2809. We
>> can't tell from the IOR exactly how it is listening on those endpoints,
>> but my guess is that it is bound specifically to localhost on port 2808
>> and 172.30.135.150 on port 2809, meaning that when your client tries to
>> connect to localhost:2809, the connection is rejected.
>>
>> How is omniNames invoked?  if you haven't done anything to it, I suspect
>> there's a bug in the Ubuntu package.

I've removed all omniorb packages I could find (including
libomniorb4-1) and reinstalled. The /etc/omniORB4.cfg file was not
removed when the packages were removed, so I deleted it manually.
Nothing in the installed packagws seems to provide it, although
apt-file claims it is in libomniorb4-1.

omniNames is not given any interesting arguments:
/etc$ ps -ef | grep omni
root     29609     1  0 10:28 ?        00:00:00 /usr/bin/omniNames
-errlog /var/log/omniorb4-nameserver.log
abayley  29640 12712  0 10:31 pts/4    00:00:00 grep --color=auto omni


I have this in /etc/omniORB4.cfg:
#InitRef = NameService=corbaloc::localhost:2809/NameService
#DefaultInitRef = corbaloc::


With that omniORB4.cfg, I have this IOR:

~$ catior IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000074000000010102000f0000003137322e33302e3133352e3135300000f90a00000b0000004e616d6553657276696365000300000000000000080000000100000000545441010000001c000000010000000100010001000000010001050901010001000000090101000354544108000000a027434e01003e99
Type ID: "IDL:omg.org/CosNaming/NamingContextExt:1.0"
Profiles:
1. IIOP 1.2 172.30.135.150 2809 "NameService"
            TAG_ORB_TYPE omniORB
            TAG_CODE_SETS char native code set: ISO-8859-1
                          char conversion code set: UTF-8
                          wchar native code set: UTF-16
                          wchar conversion code set: UTF-16

            TAG_OMNIORB_PERSISTENT_ID a027434e01003e99


And here is the test output:

~/omniorb$ sudo python server2.py -ORBtraceLevel 40
omniORB: Read from configuration file "/etc/omniORB4.cfg".
omniORB: Version: 4.1.2
omniORB: Distribution date: Thu Feb 14 14:19:08 GMT 2008 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 172.30.135.150
omniORB: 172.16.180.1
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) =
omniORB:   DefaultInitRef (args) =
omniORB:   abortOnInternalError = 0
omniORB:   abortOnNativeException = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientConnectTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   configFile = /etc/omniORB4.cfg
omniORB:   connectionWatchImmediate = 0
omniORB:   connectionWatchPeriod = 50000
omniORB:   copyValuesInLocalCalls = 1
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublish = addr
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   idleThreadTimeout = 10
omniORB:   immediateAddressSwitch = 0
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   maxSocketRecv = 2147483647
omniORB:   maxSocketSend = 2147483647
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   resetTimeOutOnRetries = 0
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   socketSendBuffer = -1
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 = 0
omniORB:   traceLevel = 40
omniORB:   traceThreadId = 0
omniORB:   traceTime = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: omniORBpy distribution date: Thu Feb 14 14:20:23 GMT 2008 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::0'
omniORB: Python thread state scavenger start.
omniORB: Bind to address 0.0.0.0
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:172.30.135.150:42046
omniORB: Publish endpoint 'giop:tcp:172.30.135.150:42046'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:172.30.135.150:42046
omniORB: Adding root<0> (activating) to object table.
omniORB: State root<0> (activating) -> active
omniORB: Creating ref to local: root<0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:Example/Echo:1.0
omniORB: Creating Python ref to local: root<0>
 target id      : IDL:Example/Echo:1.0
 most derived id: IDL:Example/Echo:1.0
omniORB: ObjRef(IDL:Example/Echo:1.0) -- deleted.
omniORB: throw NO_RESOURCES from initRefs.cc:699
(NO,NO_RESOURCES_InitialRefNotFound)
Traceback (most recent call last):
  File "server2.py", line 21, in <module>
    obj         = orb.resolve_initial_references("NameService")
  File "/usr/lib/python2.6/dist-packages/omniORB/CORBA.py", line 566,
in resolve_initial_references
    return _omnipy.orb_func.resolve_initial_references(self, identifier)
omniORB.CORBA.NO_RESOURCES:
CORBA.NO_RESOURCES(omniORB.NO_RESOURCES_InitialRefNotFound,
CORBA.COMPLETED_NO)
omniORB: ObjRef(IDL:Example/Echo:1.0) -- deleted.
omniORB: ORB not destroyed; no final clean-up.



If I uncomment the two lines in omniORB4.cfg, I get this test output:

~/omniorb$ sudo python server2.py -ORBtraceLevel 40
omniORB: Read from configuration file "/etc/omniORB4.cfg".
omniORB: Version: 4.1.2
omniORB: Distribution date: Thu Feb 14 14:19:08 GMT 2008 dgrisby
omniORB: My addresses are:
omniORB: 127.0.0.1
omniORB: 172.30.135.150
omniORB: 172.16.180.1
omniORB: ::1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: ISO-8859-1 UTF-8.
omniORB: Transmission char code sets: ISO-8859-1(1.2) ISO-8859-1(1.1)
ISO-8859-1(1.0) UTF-8(1.2) UTF-8(1.1).
omniORB: Native wide char code sets: UTF-16.
omniORB: Transmission wide char code sets: UTF-16(1.2).
omniORB: Information: the omniDynamic library is not linked.
omniORB: Current configuration is as follows:
omniORB:   DefaultInitRef (file) = corbaloc::
omniORB:   DefaultInitRef (args) =
omniORB:   InitRef = NameService=corbaloc::localhost:2809/NameService
omniORB:   abortOnInternalError = 0
omniORB:   abortOnNativeException = 0
omniORB:   acceptBiDirectionalGIOP = 0
omniORB:   acceptMisalignedTcIndirections = 0
omniORB:   bootstrapAgentHostname =
omniORB:   bootstrapAgentPort = 900
omniORB:   clientCallTimeOutPeriod = 0
omniORB:   clientConnectTimeOutPeriod = 0
omniORB:   clientTransportRule = * unix,ssl,tcp
omniORB:   configFile = /etc/omniORB4.cfg
omniORB:   connectionWatchImmediate = 0
omniORB:   connectionWatchPeriod = 50000
omniORB:   copyValuesInLocalCalls = 1
omniORB:   diiThrowsSysExceptions = 0
omniORB:   dumpConfiguration = 0
omniORB:   endPoint = giop:tcp::
omniORB:   endPointPublish = addr
omniORB:   giopMaxMsgSize = 2097152
omniORB:   giopTargetAddressMode = KeyAddr
omniORB:   id = omniORB4
omniORB:   idleThreadTimeout = 10
omniORB:   immediateAddressSwitch = 0
omniORB:   inConScanPeriod = 180
omniORB:   lcdMode = 0
omniORB:   maxGIOPConnectionPerServer = 5
omniORB:   maxGIOPVersion = 1.2
omniORB:   maxInterleavedCallsPerConnection = 5
omniORB:   maxServerThreadPerConnection = 100
omniORB:   maxServerThreadPoolSize = 100
omniORB:   maxSocketRecv = 2147483647
omniORB:   maxSocketSend = 2147483647
omniORB:   nativeCharCodeSet = ISO-8859-1
omniORB:   nativeWCharCodeSet = UTF-16
omniORB:   objectTableSize = 0
omniORB:   offerBiDirectionalGIOP = 0
omniORB:   oneCallPerConnection = 1
omniORB:   outConScanPeriod = 120
omniORB:   poaHoldRequestTimeout = 0
omniORB:   poaUniquePersistentSystemIds = 1
omniORB:   principal = [Null]
omniORB:   resetTimeOutOnRetries = 0
omniORB:   scanGranularity = 5
omniORB:   serverCallTimeOutPeriod = 0
omniORB:   serverTransportRule = * unix,ssl,tcp
omniORB:   socketSendBuffer = -1
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 = 0
omniORB:   traceLevel = 40
omniORB:   traceThreadId = 0
omniORB:   traceTime = 0
omniORB:   unixTransportDirectory = /tmp/omni-%u
omniORB:   unixTransportPermission =  777
omniORB:   useTypeCodeIndirections = 1
omniORB:   verifyObjectExistsAndType = 1
omniORB: omniORBpy distribution date: Thu Feb 14 14:20:23 GMT 2008 dgrisby
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::0'
omniORB: Python thread state scavenger start.
omniORB: Bind to address 0.0.0.0
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:172.30.135.150:40859
omniORB: Publish endpoint 'giop:tcp:172.30.135.150:40859'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:172.30.135.150:40859
omniORB: Adding root<0> (activating) to object table.
omniORB: State root<0> (activating) -> active
omniORB: Creating ref to local: root<0>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id: IDL:Example/Echo:1.0
omniORB: Creating Python ref to local: root<0>
 target id      : IDL:Example/Echo:1.0
 most derived id: IDL:Example/Echo:1.0
omniORB: ObjRef(IDL:Example/Echo:1.0) -- deleted.
omniORB: Creating ref to remote: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id:
omniORB: Initial reference `NameService' resolved from configuration file.
omniORB: Creating Python ref to remote: key<NameService>
 target id      : IDL:omg.org/CORBA/Object:1.0
 most derived id:
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: Client attempt to connect to giop:tcp:localhost:2809
omniORB: Scavenger task execute.
omniORB: Switch rope to use address giop:tcp:localhost:2809
omniORB: Unable to open new connection: giop:tcp:localhost:2809
omniORB: throw giopStream::CommFailure from
giopStream.cc:1148(0,NO,TRANSIENT_ConnectFailed)
omniORB: throw TRANSIENT from omniObjRef.cc:789 (NO,TRANSIENT_ConnectFailed)
Traceback (most recent call last):
  File "server2.py", line 22, in <module>
    rootContext = obj._narrow(CosNaming.NamingContext)
  File "/usr/lib/python2.6/dist-packages/omniORB/CORBA.py", line 787, in _narrow
    return _omnipy.narrow(self, repoId, 1)
omniORB.CORBA.TRANSIENT:
CORBA.TRANSIENT(omniORB.TRANSIENT_ConnectFailed, CORBA.COMPLETED_NO)
omniORB: ObjRef(IDL:Example/Echo:1.0) -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ORB not destroyed; no final clean-up.


I'm not sure how /etc/omniORB4.cfg should look. I notice that the IOR
written to /var/log/omniorb4-nameserver.log is the same for both tests
(i.e. uncommenting the two lines in omniORB4.cfg doesn't change the
IOR, where I presume the ports and addresses are encoded).

Thanks,
Alistair



More information about the omniORB-list mailing list