Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.7.12, 3.0.1
-
None
-
Linux, and Windows, although should be evident on all platforms
-
Unknown
Description
On updating CXF from 2.3.5 to 2.7.12 in our product we noticed that our CorbaBinding tests are failing during bus shutdown with the ORB (Orbix in this case).
It appears that a CXF commit around CXF 2.5 added a "deactivate()" call into the CorbaDestination.stop() method:
commit 88835b13e975c1716cc241c3caaf886c1f52ca40 Author: J. Daniel Kulp <dkulp@apache.org> Date: Fri Mar 23 14:54:49 2012 +0000 Fix problem with calling stop()on Corba endpoints not properly de-registering the endpoint. git-svn-id: https://svn.apache.org/repos/asf/cxf/trunk@1304394 13f79535-47bb-0310-9956-ffa450edef68
This method gets hit during either Endpoint.stop() call or a Bus.shutdown() call, when we've already published a Corba Endpoint (via the JAX_WS Endpoint.publish() api. The stop()/shutdown() results in an ObjectNotActive Corba exception being thrown. From what I can see, I'd gather we've one of two scenarios happening here:
- There's another deactivate_object() call on a POA instance with the same oid, the second call will emit an ObjectNotActive.
- The objectId is never in the AOM, and deactivate_object() will throw the exception when it can't be found.
Either way expecting the application code to catch such an exception isn't the right thing to be doing IMO.
Below is a proposed git patch for 2.7.12 (it's identical for 3.0.1), that will have CXF consume the ObjectNotActive exception, and just log (at info level) that it's being caught.
diff --git a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java index b94de2f..ed1deb9 100644 --- a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java +++ b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/CorbaDestination.java @@ -52,6 +52,7 @@ import org.omg.PortableServer.LifespanPolicyValue; import org.omg.PortableServer.POA; import org.omg.PortableServer.POAHelper; import org.omg.PortableServer.POAManager; +import org.omg.PortableServer.POAPackage.ObjectNotActive; import org.omg.PortableServer.RequestProcessingPolicyValue; import org.omg.PortableServer.Servant; import org.omg.PortableServer.ThreadPolicyValue; @@ -356,6 +357,9 @@ public class CorbaDestination implements MultiplexDestination { try { bindingPOA.deactivate_object(objectId); + } catch (ObjectNotActive ona) { + LOG.info("Caught ObjectNotActive exception: " + ona + + " during deactivate_object() call on POA: " + bindingPOA); } catch (Exception ex) { throw new CorbaBindingException("Unable to deactivate CORBA servant", ex); }