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

CORBA read_Object(interface) throws CORBA MARSHAL exception

XMLWordPrintable

    • beta2
    • sparc
    • solaris_2.5.1
    • Not verified



        Name: md23716 Date: 01/02/2001

        The problem is a discrepancy between the stubs generated by IBM's rmic and
        Sun's rmic. Both versions are valid in CORBA, therefore both runtimes
        should be able to work with either stub. However the Sun runtime throws an
        exception with the IBM stub.

        For a remote interface Hello, with a method :
             public Hello getHello() throws java.rmi.RemoteException;

        the following are all possible valid syntax within the getHello() method of
        the stub _Hello_Stub:
             return (Hello) in.read_Object (Hello.class);
        or
             return (Hello) in.read_Object (_Hello_Stub.class);
        or
             return (Hello) PortableRemoteObject.narrow (in.readObject(),
        Hello.class);

        However the Sun runtime does not handle the first of these.

        As a reference, see the resolution of issue #2804 of the Java to IDL RTF,
        at: ftp://ftp.omg.org/pub/docs/ptc/00-01-05.html#Issue2804, :
             3. In section 1.21.4.1 of formal/99-07-53, replace the description of
             read_Object
                by the following:

                For read_Object, the clz argument is one of the following:
                 . the Class object for the stub class which corresponds to the
                   type that is statically expected. Typicallyread_Object(, the ORB runtime will
                   allocate and return a stub object of this stub class.
                   the Class object for the RMI/IDL interface type that is statically
                   expected. The ORB runtime must allocate and return a stub object that
                   conforms to this interface.0


        The Sun JDK throws a CORBA MARSHAL exception.
        Also fails at 122.

        Suggested Fix
        Modify the CDRInputStream read_Object method to accept all valid syntax.
        Optionally, also modify the stub generator to emit the new-style syntax.


        ======================================================================

              eandersosunw Everett Anderson (Inactive)
              mdevereuorcl Michelle Devereux (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: