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

regression: a CORBA clinet hangs, when calling remote mothod

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.3.1
    • other-libs
    • x86
    • windows_nt



      Name: boT120536 Date: 04/12/2001


      java version "1.3.1-rc1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-rc1-b21)
      Java HotSpot(TM) Client VM (build 1.3.1-rc1-b21, interpreted mode)

      A CORBA client hangs with JDK1.3.1-RC1, though it works well with JDK1.3.0 and
      JDK1.2.x.
      Invoking remote method does not reach at CORBA server.

      CORBA Server:
          INTERSTAGE V3.0 (Fujitsu)


      1. IDL as follows:
          module ACCOUNTS {
              interface MOMAINIF {
                  long MAINPROC( inout string inoutustring );
              };
          };

      2.Compiling IDL and insert debugging information:
          c:\> c:\jdk1.3.1\bin\idlj ACCOUNTS.idl
          
          Then, edit _MOMAINIFStub.java. (_MOMAINIFStub.#MAINPROC())
                public int MAINPROC (org.omg.CORBA.StringHolder inoutustring)
                {
                  org.omg.CORBA.portable.InputStream _in = null;
                  try {
                     org.omg.CORBA.portable.OutputStream _out = _request ("MAINPROC",true);
                     _out.write_string (inoutustring.value);
                System.out.println("start _invoke()"); // for debugging
                     _in = _invoke (_out);
                System.out.println("finish _invoke()"); // for debugging
                     int __result = _in.read_long ();
                     inoutustring.value = _in.read_string ();
                     return __result;
                  } catch (org.omg.CORBA.portable.ApplicationException _ex) {
                     _in = _ex.getInputStream ();
                     String _id = _ex.getId ();
                     throw new org.omg.CORBA.MARSHAL (_id);
                  } catch (org.omg.CORBA.portable.RemarshalException _rm) {
                     return MAINPROC (inoutustring);
                  } finally {
                      _releaseReply (_in);
                  }
                } // MAINPROC
          
          c:\> c:\jdk1.3.1\bin\javac ACCOUNTS\*.java

      3.CORBA client source as follows:
          class iorTest {
              static ORB orb = ORB.init( "ACCOUNTS.ior", null );

              public static void main(String[] args) {
                  ACCOUNTS.MOMAINIF accounts;

                  org.omg.CORBA.Object obj = getObject(args[0]);
                  accounts = ACCOUNTS.MOMAINIFHelper.narrow(obj);

                  StringHolder wk_msg = new StringHolder("test string");
                  int ret = accounts.MAINPROC(wk_msg);
                  System.out.println("ret = " + ret);
                  System.out.println("wk_msg = " + wk_msg.value);
              }


              public static org.omg.CORBA.Object getObject( String filename ) {
                  try {
                      BufferedReader fin = new BufferedReader(new FileReader (filename ));
                      String line = fin.readLine();
                      fin.close();
                      return orb.string_to_object(line);
                  } catch ( Exception e ) {
                      e.printStackTrace();
                  }
                  return null;
              }
          }


      4.ACCOUNTS.ior as follows:
          
      IOR:010000001a00000049444c3a4143434f554e54532f4d4f4d41494e49463a312e300000000100
      0000000000006b00000001010000070000006170746976610000421f000053000000000200003ac1
      6c9e000001bc0000001a49444c3a4143434f554e54532f4d4f4d41494e49463a312e300000000000
      001a49444c3a4143434f554e54532f4d4f4d41494e49463a312e3000000000000000000000


      5.Running CORBA client:
          C:\> c:\jdk1.3.1\bin\java -cp . iorTest e:\etc\ior\ACCOUNTS.ior
          start _invoke()

              ... It hangs. The message "finish _invoke()" is never printed.
          
          C:\> c:\jdk1.3\bin\java -cp . iorTest e:\etc\ior\ACCOUNTS.ior
          start _invoke()
          finish _invoke()
          ret = 0
          wk_msg = xxxxxxxxxxxxxxxx

              ... There is no problem.
      (Review ID: 120633)
      ======================================================================

            hputtaswsunw Hemanth Puttaswamy (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: