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

Cannot read WStringValue from VisiBroker

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: other-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description



      Name: jl125535 Date: 08/06/2003


      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

      FULL OS VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Original bug id for this problem is: 4323267. This problem is not fixed in java 1.4.2, because its ORB is still not interoperable with VisiBroker (we use version 04.05.01.C1.08). Workaround proposed in original submission does not work. However, hereby I'm going to describe the problem in more detail, will explain where the bug is and what is the right workaround and fix for this bug.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      We use the following simple IDL file:

      ---- cut here ----

      #include "orb.idl"

      interface Test {
        ::CORBA::WStringValue ping ();
        #pragma ID ping "RMI:Test/ping:0000000000000000"
      };
      #pragma ID Test "RMI:Test:0000000000000000"

      interface TestHome {
        ::Test create ();
        #pragma ID create "RMI:TestHome/create:0000000000000000"
      };
      #pragma ID TestHome "RMI:TestHome:0000000000000000"
      ---- cut here ----

      We attempt to call Test.ping.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      This should work.
      ACTUAL -
      Exception is thrown.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      org.omg.CORBA.MARSHAL: No class description available (value_tag indicates no type information present) vmcid: 0x0 minor code: 0 completed: No
      at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1158)
      at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:297)
      at org.omg.CORBA.WStringValueHelper.read(WStringValueHelper.java:97)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      org.omg.CORBA.Object objRef = orb.string_to_object(ior);
      NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

      // resolve the Object Reference in Naming
      TestHome TestHomeImpl = TestHomeHelper.narrow(ncRef.resolve_str(HOME_NAME));
      System.out.println("Obtained TestHome: " + TestHomeImpl);

      // Create Test
      Test TestImpl = TestHomeImpl.create();
      System.out.println("Created Test: " + TestImpl);

      System.out.println("PING: " + TestImpl.ping());

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      The bug is actully in CDRInputStream_1_0 class: (line 1158). It simply should not throw exception if there's no typeinfo. Instead, this line shall be replaced with the following code:

      return factory.read_value(this);

      This provides appropriate interoperability.

      There is also a workaround that does not involve patching of "rt.jar". The workaround is: Replace reference to ::CORBA::WStringValue in IDL file with reference to ::PATCH::WStringValue. Add the following lines to IDL file:

      module PATCH {
        valuetype WStringValue wstring;
      };

      Compile this with idlj, and then manualy edit generated PATH.WStringValueHelper: replace generated implementation of "public static String read (org.omg.CORBA.portable.InputStream istream)" with the following method:

        int skip = istream.read_long();
        return (String)_instance.read_value(istream);

      This implementation of WStringValueHelper will read VisiBroker's WStringValue in a proper way.
      (Incident Review ID: 193271)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jleesunw Jon Lee (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: