[omniORB] Issues with running client on distant machine
Anup Rao
anup.kadam at gmail.com
Thu Mar 6 01:25:11 GMT 2008
Hi,
I am new to CORBA and I am using OmniOrbPy to develop my skills.
I have a Server Client Implementation which works well when run on the same
machine.
If I attempt to run the client on another machine I get errors.
Surprisingly, the code works well across machines if I comment out the lines
oClient = oORB.string_to_object("corbaname:rir:#oClient.obj")
print oClient.GetState()
in the myserver.py implementation.
However, I need to read back the Client state for the application I am
trying to develop.
The errors and full source code follows.
---8<---Error reported by client on different machine-----------------------
-----------------------------------------------------------------------
Traceback (most recent call last):
File "myClient.py", line 36, in <module>
print oServer.GetState()
File "H:\a\ar\ar210\WindowsProfile\My
Documents\SpringTerm\DS\Code\CallTest_idl.py", line 96, in GetState
return _omnipy.invoke(self, "GetState",
_0_CallTest.imyServer._d_GetState, args)
omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(
omniORB.COMM_FAILURE_MarshalArguments, CORBA.COMPLETED_NO)
---8<---Error reported by server
----------------------------------------------------------------------------------------------
omniORB: Read from configuration file "server.cfg".
omniORB: Version: 4.1.1
omniORB: Distribution date: Sun Oct 7 16:41:47 BST 2007 dgrisby
omniORB: Warning: unable to create an IPv6 socket. Unable to obtain the list
of IPv6 interface addresses (10047).
omniORB: My addresses are:
omniORB: 139.184.50.152
omniORB: 127.0.0.1
omniORB: Maximum supported GIOP version is 1.2
omniORB: Native char code sets: UTF-8 ISO-8859-1.
omniORB: Transmission char code sets: UTF-8(1.2) UTF-8(1.1) ISO-8859-1(1.2)
ISO-8859-1(1.1) ISO-8859-1(1.0).
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: InitRef = NameService=corbaname::
aldgate.tn.informatics.scitech.sussex.ac.uk:8000
omniORB: abortOnInternalError = 0
omniORB: abortOnNativeException = 0
omniORB: acceptBiDirectionalGIOP = 1
omniORB: acceptMisalignedTcIndirections = 0
omniORB: bootstrapAgentHostname =
omniORB: bootstrapAgentPort = 900
omniORB: clientCallTimeOutPeriod = 0
omniORB: clientConnectTimeOutPeriod = 0
omniORB: clientTransportRule = * unix,ssl,tcp
omniORB: configFile = server.cfg
omniORB: connectionWatchImmediate = 0
omniORB: connectionWatchPeriod = 50000
omniORB: copyValuesInLocalCalls = 1
omniORB: diiThrowsSysExceptions = 0
omniORB: dumpConfiguration = 0
omniORB: endPoint = giop:tcp::8002
omniORB: endPointPublish = addr
omniORB: giopMaxMsgSize = 2097152
omniORB: giopTargetAddressMode = KeyAddr
omniORB: id = omniORB4
omniORB: idleThreadTimeout = 10
omniORB: inConScanPeriod = 180
omniORB: lcdMode = 0
omniORB: maxGIOPConnectionPerServer = 5
omniORB: maxGIOPVersion = 1.2
omniORB: maxInterleavedCallsPerConnection = 5
omniORB: maxServerThreadPerConnection = 100
omniORB: maxServerThreadPoolSize = 100
omniORB: maxSocketRecv = 131072
omniORB: maxSocketSend = 131072
omniORB: nativeCharCodeSet = ISO-8859-1
omniORB: nativeWCharCodeSet = UTF-16
omniORB: objectTableSize = 0
omniORB: offerBiDirectionalGIOP = 1
omniORB: oneCallPerConnection = 0
omniORB: outConScanPeriod = 120
omniORB: poaHoldRequestTimeout = 0
omniORB: poaUniquePersistentSystemIds = 1
omniORB: principal = [Null]
omniORB: resetTimeOutOnRetries = 0
omniORB: scanGranularity = 5
omniORB: serverCallTimeOutPeriod = 0
omniORB: serverTransportRule = * bidir,unix,tcp,ssl
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 = 0
omniORB: traceLevel = 25
omniORB: traceThreadId = 0
omniORB: traceTime = 0
omniORB: unixTransportDirectory = /tmp/omni-%u
omniORB: unixTransportPermission = 777
omniORB: useTypeCodeIndirections = 1
omniORB: verifyObjectExistsAndType = 1
omniORB: omniORBpy distribution date: Sun Oct 7 16:38:58 BST 2007 dgrisby
omniORB: Python thread state scavenger start.
omniORB: Initialising incoming endpoints.
omniORB: Instantiate endpoint 'giop:tcp::8002'
omniORB: Attempt to set socket to listen on IPv4 and IPv6.
omniORB: Unable to set socket to listen on IPv4 and IPv6. Fall back to just
IPv4.
omniORB: Bind to address 0.0.0.0
omniORB: Publish specification: 'addr'
omniORB: Try to publish 'addr' for endpoint giop:tcp:139.184.50.152:8002
omniORB: Publish endpoint 'giop:tcp:139.184.50.152:8002'
omniORB: Starting serving incoming endpoints.
omniORB: AsyncInvoker: thread id = 2 has started. Total threads = 1
omniORB: giopRendezvouser task execute for giop:tcp:139.184.50.152:8002
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:CallTest/imyServer:1.0
omniORB: Creating Python ref to local: root<0>
target id : IDL:CallTest/imyServer:1.0
most derived id: IDL:CallTest/imyServer:1.0
omniORB: ObjRef(IDL:CallTest/imyServer: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: Client attempt to connect to giop:tcp:
aldgate.tn.informatics.scitech.sussex.ac.uk:8000
omniORB: AsyncInvoker: thread id = 3 has started. Total threads = 2
omniORB: Scavenger task execute.
omniORB: Client opened connection to giop:tcp:139.184.50.152:8000
omniORB: sendChunk: to giop:tcp:139.184.50.152:8000 100 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.152:8000 25 bytes
omniORB: Creating Python ref to remote: key<NameService>
target id : IDL:omg.org/CosNaming/NamingContext:1.0
most derived id:
omniORB: ObjRef() -- deleted.
omniORB: LocateRequest to remote: key<NameService>
omniORB: sendChunk: to giop:tcp:139.184.50.152:8000 31 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.152:8000 20 bytes
omniORB: sendChunk: to giop:tcp:139.184.50.152:8000 228 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.152:8000 24 bytes
omniORB: Server accepted connection from giop:tcp:139.184.50.153:2098
omniORB: AsyncInvoker: thread id = 5 has started. Total threads = 3
omniORB: giopWorker task execute.
omniORB: Accepted connection from giop:tcp:139.184.50.153:2098 because of
this rule: "* bidir,unix,tcp,ssl"
omniORB: inputMessage: from giop:tcp:139.184.50.153:2098 38 bytes
omniORB: Handling a GIOP LOCATE_REQUEST.
omniORB: sendChunk: to giop:tcp:139.184.50.153:2098 20 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.153:2098 122 bytes
omniORB: Receive codeset service context and set TCS to (ISO-8859-1,UTF-16)
omniORB: receive bidir IIOP service context: ( 139.184.50.153:2096 )
omniORB: Accepted request from giop:tcp:139.184.50.153:2098 to switch to
bidirectional because of this rule: "* bidir,unix,tcp,
sl"
omniORB: Creating new Python state for thread id 19820
omniORB: Initial reference `NameService' resolved from configuration file.
omniORB: sendChunk: to giop:tcp:139.184.50.152:8000 100 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.152:8000 25 bytes
omniORB: Creating ref to remote: key<NameService>
target id : IDL:omg.org/CosNaming/NamingContext:1.0
most derived id:
omniORB: string_to_object attempting to resolve `oClient.obj' from naming
service
omniORB: sendChunk: to giop:tcp:139.184.50.152:8000 80 bytes
omniORB: inputMessage: from giop:tcp:139.184.50.152:8000 172 bytes
omniORB: Creating ref to remote: root<0>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:CallTest/imyClient:1.0
omniORB: ObjRef() -- deleted.
omniORB: Creating Python ref to remote: root<0>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:CallTest/imyClient:1.0
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef(IDL:CallTest/imyClient:1.0) -- deleted.
omniORB: LocateRequest to remote: root<0>
omniORB: Client attempt to connect to giop:tcp:139.184.50.153:2096
omniORB: Client opened connection to giop:tcp:139.184.50.153:2096
omniORB: sendChunk: to giop:tcp:139.184.50.153:2096 38 bytes
omniORB: Switch rope to use address giop:tcp:139.184.50.153:2096
omniORB: Error in network send: giop:tcp:139.184.50.153:2096
omniORB: throw giopStream::CommFailure from giopStream.cc
:1182(0,NO,COMM_FAILURE_MarshalArguments)
omniORB: Client connection refcount = 0
omniORB: Client close connection to giop:tcp:139.184.50.153:2096
omniORB: Caught a CORBA system exception during up-call: IDL:
omg.org/CORBA/COMM_FAILURE:1.0
Traceback (most recent call last):
File "myServer.py", line 19, in GetState
print oClient.GetState()
File "H:\a\ar\ar210\WindowsProfile\My
Documents\SpringTerm\DS\Code\CallTest_idl.py", line 46, in GetState
return _omnipy.invoke(self, "GetState",
_0_CallTest.imyClient._d_GetState, args)
omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(
omniORB.COMM_FAILURE_MarshalArguments, CORBA.COMPLETED_NO)
omniORB: throw COMM_FAILURE from pyExceptions.cc:177
(NO,COMM_FAILURE_MarshalArguments)
omniORB: sendChunk: to giop:tcp:139.184.50.153:2098 72 bytes
omniORB: Error in network receive (start of message): giop:tcp:
139.184.50.153:2098
omniORB: throw giopStream::CommFailure from giopStream.cc
:874(0,NO,COMM_FAILURE_UnMarshalArguments)
omniORB: Server connection refcount = 1
omniORB: select() returned WSAENOTSOCK / WSAEINVAL.
omniORB: Server connection refcount = 0
omniORB: Server close connection from giop:tcp:139.184.50.153:2098
omniORB: Deleting Python state for thread id 19820 (thread exit)
omniORB: AsyncInvoker: thread id = 5 has exited. Total threads = 3
omniORB: Scanning Python thread states.
omniORB: Scavenger close connection to giop:tcp:139.184.50.152:3555
omniORB: sendCloseConnection: to giop:tcp:139.184.50.152:3555 12 bytes
omniORB: Client connection refcount (forced) = 0
omniORB: Client close connection to giop:tcp:139.184.50.152:3555
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef(IDL:CallTest/imyClient:1.0) -- deleted.
Traceback (most recent call last):
File "myServer.py", line 41, in <module>
oORB.run()
File "H:\a\ar\ar210\WindowsProfile\My
Documents\SpringTerm\DS\Code\CORBA.py", line 587, in run
KeyboardInterrupt
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ObjRef(IDL:CallTest/imyServer:1.0) -- deleted.
omniORB: omniRemoteIdentity deleted.
omniORB: ObjRef() -- deleted.
omniORB: ORB not destroyed; no final clean-up.
####################################################################################################
SOURCE CODE
--8<----------
CallTest.idl------------------------------------------------------------------------------------------------------------------
module CallTest
{
interface imyClient
{
short GetState();
};
interface imyServer
{
short GetState();
};
};
--8<-------
myServer.py---------------------------------------------------------------------------------------------------------------------
import sys
import CORBA
import CosNaming
import CallTest
import CallTest__POA
oORB = None
class myServer (CallTest__POA.imyServer):
def __init__(self):
self.State = 0
def GetState(self):
global oORB
oClient = oORB.string_to_object("corbaname:rir:#oClient.obj")
print oClient.GetState()
self.State = self.State + 5
return self.State
oORB = CORBA.ORB_init(sys.argv,CORBA.ORB_ID)
oPOA = oORB.resolve_initial_references("RootPOA")
oPOA._get_the_POAManager().activate()
servantmyServer = myServer()
oPOA.activate_object(servantmyServer)
objrefmyServer = servantmyServer._this()
oNameRoot = oORB.resolve_initial_references("NameService")
oNameRoot = oNameRoot._narrow(CosNaming.NamingContext)
if None == oNameRoot:
print "Did not locate a valid naming service. Please check setup."
sys.exit(1)
oName = [CosNaming.NameComponent("oServer","obj")]
oNameRoot.rebind(oName,objrefmyServer)
oORB.run()
--8<---------
myClient.py--------------------------------------------------------------------------------------------------------------------------
import sys
import CORBA
import CosNaming
import CallTest
import CallTest__POA
class myClient (CallTest__POA.imyClient):
def __init__(self):
self.State = 0
def GetState(self):
self.State = self.State + 7
return self.State
oORB = CORBA.ORB_init(sys.argv,CORBA.ORB_ID)
oPOA = oORB.resolve_initial_references("RootPOA")
oPOA._get_the_POAManager().activate()
servantmyClient = myClient()
idClient = oPOA.activate_object(servantmyClient)
objrefmyClient = servantmyClient._this()
oNameRoot = oORB.resolve_initial_references("NameService")
oNameRoot = oNameRoot._narrow(CosNaming.NamingContext)
if None == oNameRoot:
print "Did not locate a valid naming service. Please check setup."
sys.exit(1)
oName = [CosNaming.NameComponent("oClient","obj")]
oNameRoot.rebind(oName,objrefmyClient)
oServer = oORB.string_to_object("corbaname:rir:#oServer.obj")
print oServer.GetState()
print "Client has finished"
---8<-------------------------------------------------------------------------------------------------------------------------
Kindly let me know the flaw in my approach. Please bear with any ignorance
on my part as these concepts are new to me.
Any help would be appreciated.
Regards,
Anup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080306/3a2350c8/attachment-0001.htm
More information about the omniORB-list
mailing list