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

Incorrect marshalling of an abstract interface

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_9

      Description

      It appears that the Sun ORB is marshalling a particular Abstract Interface
      as a valuetype, in violation of the CORBA specification.

      net.jini.core.entry.Entry is an empty interface that extends
      java.io.Serializable.

      % more net/jini/core/entry/Entry.java
      package net.jini.core.entry;

       public abstract interface Entry extends java.io.Serializable {
       };
      %

      We have just started a valuetype of net.jini.core.entry.Entry[].
      That is an array type, so we expect an IDL sequence in the stream.

      0200: 34333632 30360000 7FFFFF03 FFFFFFFF 436206.. .......
      0210: FFFFFE1C 00000032 524D493A 5B4C6E65 .......2RMI:[Lne
      0220: 742E6A69 6E692E63 6F72652E 656E7472 t.jini.core.entr
      0230: 792E456E 7472793B 3A303030 30303030 y.Entry;:0000000
      0240: 30303030 30303030 30000000 000000000...

      The next entry should be a CORBA long telling us the sequence length.
      Note there are 2 bytes of padding.

                                       00000012 ....

      There should be 12 entries in this sequence. Now,
      net.jini.core.entry.Entry should be marshalled as an abstract
      interface, which would mean we would expect a boolean next.

      0250: 7FFFFF03 FFFFFFFF FFFFFDD4 00000056 ..............V

      Hey! This is a value tag instead of a boolean! This is clearly wrong.
      I will explain below...
      Meanwhile, here is a bit more of the comm trace for context

      0260: 524D493A 636F6D2E 77696E63 6F726E69 RMI:com.wincorni
      0270: 78646F72 662E6461 6E63652E 64657669 xdorf.dance.devi
      0280: 63652E65 6E747279 2E446576 69636554 ce.entry.DeviceT
      0290: 7970653A 42393739 43304439 37413034 ype:B979C0D97A04
      02A0: 38334546 3A303030 30304145 41334132 83EF:00000AEA3A2
      02B0: 34344144 33000000 7FFFFF02 00000023 44AD3... ......#

      net.jini.core.entry.Entry is an empty interface that extends
      java.io.Serializable. According to the java-to-idl mapping, it maps
      to an abstract interface in IDL. I have generated the IDL for it and
      included it below.

      % more net/jini/core/entry/Entry.idl
      /**
      * net/jini/core/entry/Entry.idl
      * Generated by rmic -idl. Do not edit
      * 22 February 2005 21:23:52 GMT
      */

      #include "orb.idl"

      #ifndef __net_jini_core_entry_Entry__
      #define __net_jini_core_entry_Entry__


      module net {
      module jini {
      module core {
      module entry {

           abstract interface Entry {
           };

      #pragma ID Entry "RMI:net.jini.core.entry.Entry:0000000000000000"

      };
      };
      };
      };

      #endif
      %

      I have also pasted the relevant part of the CORBA spec that clarifies
      this issue.

      CORBA 2.3.1> 15.3.7 Abstract Interfaces
      CORBA 2.3.1>
      CORBA 2.3.1> Abstract interfaces are encoded as a union with a
      CORBA 2.3.1> boolean discriminator. The union has an object
      CORBA 2.3.1> reference (see Section 15.3.6, Object References,
      CORBA 2.3.1> on page 15-28) if the discriminator is TRUE, and
      CORBA 2.3.1> a value type (see Section 15.3.4, Value Types, on
      CORBA 2.3.1> page 15-14) if the discriminator is FALSE. The
      CORBA 2.3.1> encoding of value types marshaled as abstract
      CORBA 2.3.1> interfaces always includes RepositoryId
      CORBA 2.3.1> information. If there is no indication whether a
      CORBA 2.3.1> nil abstract interface represents a nil object
      CORBA 2.3.1> reference or a null valuetype, it shall be
      CORBA 2.3.1> encoded as a null valuetype.


      ###@###.### 2005-03-11 13:32:03 GMT

        Attachments

          Activity

            People

            Assignee:
            kcavanauorcl Ken Cavanaugh (Inactive)
            Reporter:
            thlenz Thomas Lenz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: