[jacorb-developer] PortableInterceptor and ServantLocator Together Cause Exception

McKnerney, Michael D (US SSA) michael.mcknerney at baesystems.com
Tue Jun 26 22:42:57 CEST 2012


Hi Nick,

Yes, the servant meets the activation condition via this case from page 95:

"By returning a Servant instance from a ServantManager. The Servant returned from PortableServer::ServantActivator::incarnate() or PortableServer::ServantLocator::preinvoke() will be associated with the ORB instance that contains the POA on which the ServantManager is installed."

See attached hello2.jar that demonstrates the issue.

Btw- I run the demo like this:

# server
/jacorb-3.0/demo/hello2/build/classes> jaco -cp ./:${JACORB_HOME}:${JACORB_HOME}/lib/jacorb.jar: ${JACORB_HOME}/lib/jacorb-services.jar:${JACORB_HOME}/lib/idl.jar -Dorg.omg.PortableInterceptor.ORBInitializerClass.demo.hello.MyInitializer -Djacorb.implname=hello -DOAAddress=iiop://:16250 demo.hello.Server GoodDay.ior

#client
/jacorb-3.0/demo/hello2/build/classes> jaco -cp ./: ./:${JACORB_HOME}:${JACORB_HOME}/lib/jacorb.jar: ${JACORB_HOME}/lib/jacorb-services.jar:${JACORB_HOME}/lib/idl.jar demo.hello.Client GoodDay.ior

The server output shows the same error:

Jun 26, 2012 8:23:02 PM org.jacorb.orb.ORBSingleton <init>
INFO: created ORBSingleton
-- pre_init, orb_id=jacorb:3.0--
Jun 26, 2012 8:23:02 PM org.jacorb.orb.giop.CodeSet getTCSDefault
WARNING: Warning - unknown codeset (ASCII) - defaulting to ISO-8859-1
-- post_init, orb_id=jacorb:3.0--
Jun 26, 2012 8:23:02 PM org.jacorb.orb.portableInterceptor.InterceptorManager <init>
INFO: InterceptorManager started with 1 Server Interceptors, 1 Client Interceptors and 1 IOR Interceptors
Creating GoodDayImpl
Registering strOid: IDL:demo/hello/GoodDay:1.0
Creating DayFactoryImpl
Registering strOid: IDL:demo/hello/DayFactory:1.0
poa_manager.activate
Jun 26, 2012 8:23:02 PM org.jacorb.orb.ORB run
INFO: ORB run
Jun 26, 2012 8:23:09 PM org.jacorb.orb.iiop.ServerIIOPConnection configure
INFO: Opened new server-side TCP/IP transport to 10.35.225.150:41518
tid=RequestProcessor-5,receive_request_service_contexts getDay
tid=RequestProcessor-5,ServantLocator.preinvoke, operation=getDay; strOid=IDL:demo/hello/DayFactory:1.0
** returning servant **
tid=RequestProcessor-5,receive_request getDay
create_reference_with_id
getDay, calling BaseHelper.narrow
tid=RequestProcessor-5,send_request _is_a
tid=RequestProcessor-5,ServantLocator.preinvoke, operation=_is_a; strOid=IDL:demo/hello/GoodDay:1.0
** returning servant **
Jun 26, 2012 8:23:09 PM org.jacorb.orb.giop.ClientConnectionManager getConnection
INFO: ClientConnectionManager: created new ClientGIOPConnection to 10.35.225.150:16250 (b76fa)
Jun 26, 2012 8:23:09 PM org.jacorb.orb.Delegate servant_preinvoke
SEVERE: unexpected exception during servant_preinvoke
org.omg.CORBA.BAD_INV_ORDER: The Servant has not been associated with an ORBinstance
        at org.omg.PortableServer.Servant._get_delegate(Servant.java:111)
        at org.omg.PortableServer.Servant._poa(Servant.java:30)
        at org.jacorb.orb.portableInterceptor.ServerRequestInfoImpl.setServant(ServerRequestInfoImpl.java:153)
        at org.jacorb.orb.portableInterceptor.ServerRequestInfoImpl.<init>(ServerRequestInfoImpl.java:133)
        at org.jacorb.orb.Delegate.servant_preinvoke(Delegate.java:2644)
        at org.jacorb.orb.Delegate.is_a(Delegate.java:1789)
        at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:53)
        at demo.hello.BaseHelper.narrow(BaseHelper.java:59)
        at demo.hello.DayFactoryImpl.getDay(DayFactoryImpl.java:30)
        at demo.hello.DayFactoryPOA._invoke(DayFactoryPOA.java:58)
        at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:349)
        at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:671)
        at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:821)
getDay, caught exception=org.omg.CORBA.BAD_INV_ORDER: The Servant has not been associated with an ORBinstance
ServantLocator.postinvoke, operation=getDay
tid=RequestProcessor-5,send_reply getDay
Jun 26, 2012 8:23:09 PM org.jacorb.orb.iiop.ServerIIOPConnection close
INFO: Closed server-side transport to 10.35.225.150:41518

Thanks for the help !

take care,
mike

-----Original Message-----
From: Nick Cross [mailto:jacorb at goots.org] 
Sent: Tuesday, June 26, 2012 1:39 AM
To: Discussions concerning CORBA development with JacORB
Cc: McKnerney, Michael D (US SSA)
Subject: Re: [jacorb-developer] PortableInterceptor and ServantLocator Together Cause Exception


Hi,

That error is coming from OMG supplied stub code. Could you verify that 
the conditions in the IDL to Java mapping 1.3 2008-01-11 , section 
4.21.3, page 94/95 have been satisfied e.g. was your Servant activated 
via the POA? If it has, then supplying a sample standalone compilable 
and runnable test case would be useful.

Regards

Nick


On 26/06/12 01:17, McKnerney, Michael D (US SSA) wrote:
> Hi,
>
> Is it a known issue when using ServantLocator together with PortableInterceptor that this exception is always raised?
>
> Jun 25, 2012 10:32:17 PM org.jacorb.orb.Delegate servant_preinvoke
> SEVERE: unexpected exception during servant_preinvoke
> org.omg.CORBA.BAD_INV_ORDER: The Servant has not been associated with an ORBinstance
>          at org.omg.PortableServer.Servant._get_delegate(Servant.java:111)
>          at org.omg.PortableServer.Servant._poa(Servant.java:30)
>          at org.jacorb.orb.portableInterceptor.ServerRequestInfoImpl.setServant(ServerRequestInfoImpl.java:153)
>          at org.jacorb.orb.portableInterceptor.ServerRequestInfoImpl.<init>(ServerRequestInfoImpl.java:133)
>          at org.jacorb.orb.Delegate.servant_preinvoke(Delegate.java:2644)
>          at org.jacorb.orb.Delegate.is_a(Delegate.java:1789)
>          at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:53)
>          at GIAS.LibraryManagerHelper.narrow(LibraryManagerHelper.java:59)
>          at baex.gl.gateway.gias.LibraryImpl.get_manager(LibraryImpl.java:81)
>
> I can post code if need be but essentially what I have is a servant (LibraryImpl) that is in the process of processing a method (get_manager) and during the processing it invokes narrow() which is handled within the same thread as the get_manager().
>
> If I take out the portable interceptor, all works as expected so I figure this might be a known issue?
>
> Thanks,
> mike
> _______________________________________________
> jacorb-developer maillist  -  jacorb-developer at lists.spline.inf.fu-berlin.de
> https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer



More information about the jacorb-developer mailing list