Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4360753

_non_existent results in null pointer exception in server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.3.0
    • other-libs
    • None
    • sparc
    • solaris_2.6

      Client calls to non_existent are handled in ClientDelegate as:

          public boolean non_existent(org.omg.CORBA.Object obj) {
              try {
                  // Invoke on server. operation name *is* _non_existent!
                  ClientRequest os = createRequest("_non_existent", false);

      On the server side we have the following code:

      POA.SpecialMethod:

      class NonExistent extends SpecialMethod {
          String getName() { // _non_existent
              return "_not_existent"; // wire name is indeed "_not_existent" !!
          }

      and

      corba.SpecialMethod:

      class NonExistent extends SpecialMethod {
          public String getName() { // _non_existent
              return "_non_existent";
          }
                                                                     
          public ServerResponse invoke(java.lang.Object servant,
                                       ServerRequest request)
          {
              boolean result = (servant == null) ? true : false;
              ServerResponse response = request.createResponse(null);
              response.write_boolean(result);
              return response;
          }
      }



      Note that the client side thinks it is sending a request for:

      _non_existent

      whereas the server side is expecting to see:

      either _not_existent or _non_existent depending on the subcontract.

      Also note the exclamation points in the comments. Regardless of the
      comments, the two are out-of-sync. When the version that expects
      _not_existent is used on the server side then in

      GenericPOAServerSC.dispatchToServant

           if (SpecialMethod.isSpecialMethod(operation)) {

      at line 342 (v 1.47) returns true but

               SpecialMethod method = SpecialMethod.getSpecialMethod(operation);
               ServerResponse resp = method.invoke(servant, req);

      the getSpecialMethod fails resulting in method.invoke(...) causing a
      NullPointerException. This is caught in the subcontract causing an
      UNKNOWN exception to be returned to the client.

      CORBA V2.3.1 (page 460):

      For GIOP 1.2 and later versions, only the operation name _non_existent
      shall be used.

      The correct operation name to use for GIOP 1.0 and 1.1 is
      _non_existent. Due to a typographical error in CORBA 2.0, 2.1, and
      2.2, some legacy implementations of GIOP 1.0 and 1.1 respond to the
      operation name _not_existent. For maximum interoperability with such
      legacy implementations, new implementations of GIOP 1.0 and 1.1 may
      wish to respond to both operation names, _non_existent and
      _not_existent.

            Unassigned Unassigned
            hcarr Harold Carr
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: