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

GIOP 1.0 reply to a GIOP 1.1 request CORBA org.omg

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • other-libs
    • merlin
    • generic
    • generic



      Name: skT45625 Date: 12/12/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-beta_refresh)
      Java HotSpot(TM) Client VM (build 1.3.0-beta_refresh, mixed mode)


      Using callbacks with a Java JDK1.3 Client and IONA Orbix C++ Server does not
      work. This is a result of the wrong version of GIOP reply being sent back on a
      GIOP 1.1 request.

      Response from IONA on the issue of using callbacks with JDK 1.3:

      >> We have seen this problem before with the Sun JDK 1.3 ORB as well as
      >> with other ORBs. You are correct that it is a GIOP versioning problem.
      >> What is happening is that the Sun ORB is returning 1.0 replies to GIOP
      >> 1.1 requests which is strictly illegal. You may want to report the
      >> problem to Sun.

      >> Best regards,
      >> Jonathan Wu
      >> Customer Services
      >> IONA Technologies



      IDL FILE used:

      module HelloApp
      {
          interface HelloCallback
          {
              void callback(in string message);
          };


          interface Hello
          {
              void register(in HelloCallback objRef);
          };
      };


      Server:
           C++ ORBIX 2000 IONA - Files can be provided upon request. Look for the
           callback line.

           // Servant which implements the HelloApp::Hello interface.
      //

      #include <stdlib.h>
      #include <iostream.h>
      #include "HelloApp_HelloImpl.h"
      #include "it_random_funcs.h"
      #include "it_print_funcs.h"


      // _create() -- create a new servant.
      // Hides the difference between direct inheritance and tie servants
      // For direct inheritance, simple create and return an instance of the servant.
      // For tie, creates an instance of the tied class and the tie, return the tie.
      //
      POA_HelloApp::Hello*
      HelloApp_HelloImpl::_create(PortableServer::POA_ptr the_poa)
      {
          return new HelloApp_HelloImpl(the_poa);
      }


      // HelloApp_HelloImpl constructor
      //
      // Note: since we use virtual inheritance, we must include an
      // initialiser for all the virtual base class constructors that
      // require arguments, even those that we inherit indirectly.
      //
      HelloApp_HelloImpl::HelloApp_HelloImpl(
          PortableServer::POA_ptr the_poa
      ) :
          IT_ServantBaseOverrides(the_poa)
      {
          // Intentionally empty.
      }


      // ~HelloApp_HelloImpl destructor.
      //
      HelloApp_HelloImpl::~HelloApp_HelloImpl()
      {
          // Intentionally empty.
          //
      }


      // _cxx_register() -- Implements IDL operation "HelloApp::Hello::register".
      //
      void
      HelloApp_HelloImpl::_cxx_register(
          HelloApp::HelloCallback_ptr objRef
      ) IT_THROW_DECL((
          CORBA::SystemException
      ))
      {
          cout << "HelloApp_HelloImpl::_cxx_register(): called." << endl;
          cout << " objRef = ";
          IT_print_HelloApp_HelloCallback(cout, objRef, 3);
          cout << endl;

          objRef->callback("Test Failed"); // FAILS RIGHT HERE!!!!!!

          // Diagnostics.
          //
          cout << "HelloApp_HelloImpl::_cxx_register(): returning"
               << endl;

      }





      Java Client:

      // Copyright and License
       
      import HelloApp.*;
      import org.omg.CosNaming.*;
      import org.omg.CORBA.*;
      import java.util.Properties;

       
      class HelloCallbackServant extends _HelloCallbackImplBase
      {
          public void callback(String notification)
          {
              System.out.println("FROM THE SERVER: " + notification);
          }
      }

      public class Client
      {
          public static void main(String args[])
          {
      try{
      // create and initialize the ORB
              Properties props = new Properties();
              props.put("org.omg.CORBA.ORBInitialHost", "boba");
              props.put("org.omg.CORBA.ORBInitialPort","1050");
              ORB orb = ORB.init(args, props);

                  // get the root naming context
       NamingContext nc = NamingContextHelper.narrow(orb.string_to_object
      ("IOR:000000000000002f49444c3a696f6e612e636f6d2f49545f4e616d696e672f49545f4e616d
      696e67436f6e746578744578743a312e30000000000001000000000000007a00010200000000076b
      65726d697400000c0300000000003f3a3e0232311744656661756c74204c6f636174696f6e20446f
      6d61696e185f64656661756c745f69745f6e635f6578745f706f615f000800020000000000000000
      00000200000000000000080000000049545f410000000600000006000000000035"));


                  // resolve the Object Reference in Naming
              NameComponent nc1 = new NameComponent("IT_GenieDemo", "");
              NameComponent nc2 = new NameComponent("HelloApp_Hello", "");
              NameComponent path[] = {nc1, nc2};

                  Hello helloRef = HelloHelper.narrow(nc.resolve(path));
       
      HelloCallbackServant helloCallbackRef = new HelloCallbackServant();
                  orb.connect(helloCallbackRef);

      // call the Hello server object and print results
      helloRef.register(helloCallbackRef);
      } catch (Exception e) {
      System.out.println("ERROR : " + e) ;
      e.printStackTrace(System.out);
      }
          }
      }


      The error message on the client:

      ERROR : org.omg.CORBA.TRANSIENT: minor code: 1230242048 completed: Maybe
      org.omg.CORBA.TRANSIENT: minor code: 1230242048 completed: Maybe
              at java.lang.Class.newInstance0(Native Method)
              at java.lang.Class.newInstance(Class.java:237)
              at com.sun.corba.se.internal.iiop.ReplyMessage.getSystemException
      (ReplyMessage.java:93)
              at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException
      (ClientResponseImpl.java:82)
              at com.sun.corba.se.internal.corba.ClientDelegate.invoke
      (ClientDelegate.java:191)
              at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:294)
              at HelloApp._HelloStub.register(_HelloStub.java:34)
              at Client.main(Client.java:43)
      (Review ID: 108554)
      ======================================================================

            eandersosunw Everett Anderson (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: