Discussion:
[omniORB] omniorbpy narrow problem (NameService Problem?)
Manuel Iglesias
2009-08-21 04:01:30 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
manuel-***@debian-box:~/example$ python adder.py
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: 192.168.1.102
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: 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 = 0
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: Python thread state scavenger start.
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::0'
omniORB: Bind to address ::
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:192.168.1.102:52561
omniORB: Publish endpoint 'giop:tcp:192.168.1.102:52561'
omniORB: Starting serving incoming endpoints.
omniORB: Adding root<0> (activating) to object table.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:192.168.1.102:52561
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:Snake/Adder:1.0
omniORB: Creating Python ref to local: root<0>
target id : IDL:Snake/Adder:1.0
most derived id: IDL:Snake/Adder:1.0
omniORB: ObjRef(IDL:Snake/Adder:1.0) -- deleted.
IOR:010000001400000049444c3a536e616b652f41646465723a312e3000010000000000000064000000010102000e0000003139322e3136382e312e3130320051cd0e000000fe76c18d4a000007b2000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: Trying to resolve initial reference `NameService'
with configuration file default `corbaloc::/NameService'
omniORB: Creating ref to remote: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Initial reference `NameService' resolved with configuration file ORBDefaultInitRef prefix.
omniORB: Creating Python ref to remote: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Client attempt to connect to giop:tcp:localhost:2809
omniORB: Switch rope to use address giop:tcp:localhost:2809
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: Scavenger task execute.
Traceback (most recent call last):
File "adder.py", line 24, in <module>
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
File "/usr/lib/python2.5/site-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:Snake/Adder:1.0) -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ORB not destroyed; no final clean-up.
Manuel Iglesias
2009-08-21 05:04:59 UTC
Permalink
I found a difference comparing the traces of my ubuntu box vs. the debian
box.

On my ubuntu box (where it works as expected) I have

omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Client attempt to connect to giop:tcp:localhost:2809
omniORB: Client opened connection to giop:tcp:127.0.0.1:2809

but in the debian box

omniORB: Client attempt to connect to giop:tcp:127.0.0.1:2809
omniORB: Switch rope to use address giop:tcp:127.0.0.1:2809
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: Scavenger task execute.
Traceback (most recent call last):
File "adder.py", line 24, in <module>
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
File "/usr/lib/python2.5/site-packages/omniORB/CORBA.py", line 787, in
_narrow
return _omnipy.narrow(self, repoId, 1)

I don't know what the Switch rope means.
It seems that for a good reason it can't establish a connection.

*Michael wrote:

Did you try to change your nameservice uri from
localhost to 127.0.0.1?

*I suspect that it handles the localhost as 127.0.0.1 looking at the above
trace, but haven't try to change that as you suggest, could you point me how
to accomplish that? Thank you.

I will really appreciate if someone have a clue about this problem.
I really will appreciate if someone could give some advice about this
problem.
Recently I was trying to re-create my application debian 5.0 box (I have
already done some developing in my ubuntu box), after all the installation I
copy the .py and .idl files of my server and run omniidl, so far everything
works.
When I run my python application I get a problem with the NameService.
I went back to the example code adder of Dr Grisby tutorial, which use
NameService. I am getting the same error, here is the exception I am getting
after executing the instruction
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
*
File "adder.py", line 24, in <module>
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
File "/usr/lib/python2.5/site-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)*
The complete trace is attached.
*import sys, CORBA, CosNaming, Snake, Snake__POA
self.value = 0
self.value = self.value + a
return self.value
self.value = 0
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
adderServant = Adder_i()
poa.activate_object(adderServant)
adderObjref = adderServant._this()
nameRoot = orb.resolve_initial_references("NameService")
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
name = [CosNaming.NameComponent("adder", "obj")]
nameRoot.rebind(name, adderObjref)
poa._get_the_POAManager().activate()
orb.run()*
I really don't know if I forgot something, because in my ubuntu box
everything works.
Thank you in advance,
Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090821/03b8db65/attachment.htm
Manuel Iglesias
2009-08-21 13:13:53 UTC
Permalink
Skipped content of type multipart/alternative-------------- next part --------------
manuel-***@debian-box:~/example$ python adder.py
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: 192.168.1.102
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: 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:127.0.0.1:2809
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 = 0
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: Python thread state scavenger start.
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp:127.0.0.1:2809'
omniORB: Explicit bind to host 127.0.0.1.
omniORB: Bind to address 127.0.0.1
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:127.0.0.1:2809
omniORB: Publish endpoint 'giop:tcp:127.0.0.1:2809'
omniORB: Starting serving incoming endpoints.
omniORB: Adding root<0> (activating) to object table.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:127.0.0.1:2809
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:Snake/Adder:1.0
omniORB: Creating Python ref to local: root<0>
target id : IDL:Snake/Adder:1.0
most derived id: IDL:Snake/Adder:1.0
omniORB: ObjRef(IDL:Snake/Adder:1.0) -- deleted.
IOR:010000001400000049444c3a536e616b652f41646465723a312e3000010000000000000060000000010102000a0000003132372e302e302e3100f90a0e000000fea8388e4a000007b7000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100
omniORB: Trying to resolve initial reference `NameService'
with configuration file default `corbaloc::/NameService'
omniORB: Creating ref to remote: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Initial reference `NameService' resolved with configuration file ORBDefaultInitRef prefix.
omniORB: Creating Python ref to remote: key<NameService>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id:
omniORB: Client attempt to connect to giop:tcp:localhost:2809
omniORB: Server accepted connection from giop:tcp:127.0.0.1:53031
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: AsyncInvoker: thread id = 4 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:127.0.0.1:53031 because of this rule: "* unix,ssl,tcp"
omniORB: Scavenger task execute.
omniORB: Client opened connection to giop:tcp:127.0.0.1:2809
omniORB: sendChunk: to giop:tcp:127.0.0.1:2809 100 bytes
omniORB:
4749 4f50 0100 0100 5800 0000 0000 0000 GIOP....X.......
0200 0000 010a 6f6d 0b00 0000 4e61 6d65 ......om....Name
5365 7276 6963 6574 0600 0000 5f69 735f Servicet...._is_
6100 696c 0000 0000 2800 0000 4944 4c3a a.il....(...IDL:
6f6d 672e 6f72 672f 436f 734e 616d 696e omg.org/CosNamin
672f 4e61 6d69 6e67 436f 6e74 6578 743a g/NamingContext:
312e 3000 1.0.
omniORB: inputMessage: from giop:tcp:127.0.0.1:53031 100 bytes
omniORB:
4749 4f50 0100 0100 5800 0000 0000 0000 GIOP....X.......
0200 0000 010a 6f6d 0b00 0000 4e61 6d65 ......om....Name
5365 7276 6963 6574 0600 0000 5f69 735f Servicet...._is_
6100 696c 0000 0000 2800 0000 4944 4c3a a.il....(...IDL:
6f6d 672e 6f72 672f 436f 734e 616d 696e omg.org/CosNamin
672f 4e61 6d69 6e67 436f 6e74 6578 743a g/NamingContext:
312e 3000 1.0.
omniORB: sendChunk: to giop:tcp:127.0.0.1:53031 76 bytes
omniORB:
4749 4f50 0100 0101 4000 0000 0000 0000 ***@.......
0200 0000 0200 0000 2700 0000 4944 4c3a ........'...IDL:
6f6d 672e 6f72 672f 434f 5242 412f 4f42 omg.org/CORBA/OB
4a45 4354 5f4e 4f54 5f45 5849 5354 3a31 JECT_NOT_EXIST:1
2e30 0052 0100 4d4f 0100 0000 .0.R..MO....
omniORB: inputMessage: from giop:tcp:127.0.0.1:2809 76 bytes
omniORB:
4749 4f50 0100 0101 4000 0000 0000 0000 ***@.......
0200 0000 0200 0000 2700 0000 4944 4c3a ........'...IDL:
6f6d 672e 6f72 672f 434f 5242 412f 4f42 omg.org/CORBA/OB
4a45 4354 5f4e 4f54 5f45 5849 5354 3a31 JECT_NOT_EXIST:1
2e30 0052 0100 4d4f 0100 0000 .0.R..MO....
Traceback (most recent call last):
File "adder.py", line 25, in <module>
nameRoot = nameRoot._narrow(CosNaming.NamingContext)
File "/usr/lib/python2.5/site-packages/omniORB/CORBA.py", line 787, in _narrow
return _omnipy.narrow(self, repoId, 1)
omniORB.CORBA.OBJECT_NOT_EXIST: CORBA.OBJECT_NOT_EXIST(omniORB.OBJECT_NOT_EXIST_NoMatch, CORBA.COMPLETED_NO)
omniORB: ObjRef(IDL:Snake/Adder:1.0) -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ORB not destroyed; no final clean-up.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omniORB4.cfg
Type: application/octet-stream
Size: 41666 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20090822/7339263b/omniORB4-0001.obj
Duncan Grisby
2009-08-21 20:48:10 UTC
Permalink
Finally I get to do the connection, but now I am getting a OBJECT_NOT_EXIST
exception.
The TRANSIENT_ConnectFailed you had before means that the naming service
isn't running, so the client is unable to connect.

The trace you've posted shows that the error is now that you have
configured your client to listen on port 2809, which is the naming
service port. (The endPoint of giop:tcp:128.0.0.1:2809.) That means
that when it tries to talk to the naming service, it is actually talking
to itself, and of course there is no root naming context in your client
code, so it tells you that the object does not exist.

Are you running omniNames? It looks like you are not.

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...