[omniORB] omniEvents pushsupp.cc vs pushsupp.py CORBA.BAD_PARAM

Chris McClimans omniorb@mcclimans.net
Wed, 13 Feb 2002 01:42:52 -0600


I ran omniEvents with -ORBtraceLevel 29 to capture more info while
running the script below. I see an omniConnectionBroken exception
from tcpSocketMTFactory.cc that raises my eyebrow. I'm still not sure
exactly what the problem is, I still may be just up too late without
strong tea and really just passing a BAD_PARAM.
-chris


SupplierAdmin_i : obtain_push_consumer Start
ProxyPushConsumer_i : Constructor Start
omniORB: Activating: boa<0x3c69d1dff3717c9c00000004>
ProxyPushConsumer_i : Activated ProxyPushConsumer
ProxyPushConsumer_i : Constructor End
SupplierAdmin_i : Registering ProxyPushConsumer Start
SupplierAdmin_i : Registering ProxyPushConsumer End
omniORB: Creating ref to local: boa<0x3c69d1dff3717c9c00000004>
 target id      : IDL:omg.org/CosEventChannelAdmin/ProxyPushConsumer:1.0
 most derived id: IDL:omg.org/CosEventChannelAdmin/ProxyPushConsumer:1.0
SupplierAdmin_i : obtain_push_consumer End
omniORB: throw omniConnectionBroken (minor 4) from tcpSocketMTfactory.cc:1076
omniORB: tcpSocketMTfactory Worker: #### Connection closed.
omniORB: tcpSocketMTfactory Worker: exit.
omniORB: tcpSocketStrand::~Strand() close socket no. 8


On Tue, Feb 12, 2002 at 05:52:57PM -0600, Chris McClimans wrote:
> I am trying to port pushsupp.cc and friends to omniORBpy.
> I checked CosEventChannelAdmin.idl and it says
> ProxyPushConsumer.connect_push_supplier() should take a single
> CosEventComm.PushSupplier as it's argument. I printed out the
> supplier._NP_RepositoryId and it looks to be of the right type to pass
> to this function.
> What else might be going on here?
> -chris
> 
> chris@ginger-ale% python ./pushsupp.py
> About to Call proxy_consumer.connect_push_supplier(supplier)
> Where suppplier._NP_RepositoryId is IDL:omg.org/CosEventComm/PushSupplier:1.0
> Traceback (most recent call last):
>   File "./pushsupp.py", line 48, in ?
>     proxy_consumer.connect_push_supplier(supplier)
>   File "CosEventChannelAdmin_idl.py", line 76, in connect_push_supplier
>     return _omnipy.invoke(self, "connect_push_supplier", _0_CosEventChannelAdmin.ProxyPushConsumer._d_connect_push_supplier, args)
> omniORB.CORBA.BAD_PARAM: Minor: 0, Completed: COMPLETED_NO.
> 
> -- pushsupp.py
> #!/usr/bin/env python
> from omniORB import CORBA
> import CosNaming, CosLifeCycle, CosEventChannelAdmin, CosEventComm
> import EventChannelAdmin, sys
> 
> orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
> 
> # Use NameService and get an omniEvents EventChannelFactory reference
> obj         = orb.resolve_initial_references("NameService")
> rootContext = obj._narrow(CosNaming.NamingContext)
> name = [CosNaming.NameComponent('EventChannelFactory',
> 				'EventChannelFactory')]
> obj = rootContext.resolve(name)
> EventChannelFactory = obj._narrow(EventChannelAdmin.EventChannelFactory)
> 
> # Use the EventChannelFactory to get an EventChannel
> key = [CosNaming.NameComponent('EventChannel','object interface')]
> criteria=[CosLifeCycle.NVP('PullRetryPeriod',CORBA.Any(CORBA.TC_ulong,1)),
>           CosLifeCycle.NVP('MaxEventsPerConsumer',CORBA.Any(CORBA.TC_ulong,0)),
>           CosLifeCycle.NVP('MaxQueueLength',CORBA.Any(CORBA.TC_ulong,0))]
> channelObj = EventChannelFactory.create_object(key,criteria)
> EventChannel = channelObj._narrow(CosEventChannelAdmin.EventChannel)
>             
> # the following logic comes from pushsupp.cc from omniEvent/examples/
> 
> # Make a PushSupplier Class and instance
> class Supplier_i(CosEventComm.PushSupplier):
>     def __init__(self):
>         pass
>     def disconnect_push_supplier(self):
>         print "EventSupplier: disconnectied."
> 
> supplier = Supplier_i()
> 
> # get the EventChannelAdmin for the Supplier
> supplier_admin = EventChannel.for_suppliers()
> 
> # get a ProxyConsumer from our EventChannelAdmin
> proxy_consumer = supplier_admin.obtain_push_consumer()
> 
> print "About to Call proxy_consumer.connect_push_supplier(supplier)"
> print "Where suppplier._NP_RepositoryId is " + supplier._NP_RepositoryId
> # here is where we get a CORBA.BAD_PARAM
> proxy_consumer.connect_push_supplier(supplier)
>     
>         
> 
>