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

ORB.string_to_object raises INV_OBJREF for a valid corbaloc URL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • other-libs
    • beta3
    • generic, x86
    • generic, windows_2000
    • Not verified



        Name: krC82822 Date: 07/25/2001


        java version "1.4.0-beta_refresh"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b72)
        Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b72, mixed mode)
        (and)
        java version "1.4.0-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
        Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, interpreted mode)

        When ORB.string_to_object is invoked with a valid corbaloc URL, the
        J2SE 1.4 ORB is internally sending a GIOP LocateRequest message. If the
        LocateRequest fails (e.g., if the server is not currently running),
        string_to_object raises INV_OBJREF.

        Ideally, the ORB should not be sending a LocateRequest message from
        string_to_object. Instead, the ORB should use late binding,
        i.e., don't bind until the first request is made on the object
        reference.

          To reproduce the INV_OBJREF exception and demonstrate that
        string_to_object is making a remote invocation, use the
        following program:

        public class Bug
        {
            public static void
            main(String[] args)
            {
                org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
                final String URL = "corbaloc:iiop:localhost:5000/NameService";
                try
                {
                    org.omg.CORBA.Object obj = orb.string_to_object(URL);
                    System.out.println("OK");
                }
                catch(org.omg.CORBA.INV_OBJREF ex)
                {
                    System.out.println("Caught INV_OBJREF!");
                    ex.printStackTrace();
                }
            }
        }

        Then follow these steps:

        1) Start tnameserv on port 5000:

          tnameserv -ORBInitialPort 5000

        2) In another window, run the example program (you should get "OK")

        3) Now stop tnameserv, and run the example again. You should
           get the following output:

        Caught INV_OBJREF!
        org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 201 completed: No
                at com.sun.corba.se.internal.corba.ORB.string_to_object(ORB.java:1897)
                at Bug.main(Bug.java:10)

        --------------

        25 Jul 2001, eval1127@eng -- reproducible with build 72:

        Caught INV_OBJREF!
        org.omg.CORBA.INV_OBJREF: vmcid: SUN minor code: 201 completed: No
                at com.sun.corba.se.internal.corba.ORB.string_to_object(ORB.java:1940)
                at Test128753.main(Test128753.java:30)

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

        (tested on Solaris 2.8)
        (Review ID: 128753)
        ======================================================================

              hputtaswsunw Hemanth Puttaswamy (Inactive)
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: