Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6041

Corba Binding is throwing a ObjectNotActive Corba exception being thrown back to application code on endpoint/bus shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.12, 3.0.1
    • 3.0.3, 2.7.14
    • CORBA Binding
    • 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);
                   }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            khalligan Keith Halligan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: