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

enumeration range exceptions are handled improperly by Joe stubs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Won't Fix
    • Affects Version/s: neo2.0_fcs
    • Fix Version/s: None
    • Component/s: other-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description

      I used the following idl to build a simple server:


      enum color_list { red, black, green };

      module foo {

        interface etest {
          color_list getColor();
          void setColor(in color_list aColor);
        };
      };

      I purposely caused an enumeration range exception to be thrown
      by writing the following Joe client code:


      import sunw.corba.*;
      import sunw.joe.*;

      import idlGlobal.*;
      import foo.*;

      public
      class etestClient {
        static Joe orb;
        static etestRef etestObject;
        static final int green=7;

        static
        void colorIs(int aColor) {
          if(aColor == color_list.red)
            System.out.println("red");
        }

        public static
        void main(String[] args) {
          int someColor;

          try {
            orb = new Joe("localhost");
            ObjectRef obj = orb.find("etest");
            etestObject = etestStub.narrow(obj);
            
            etestObject.setColor(color_list.red);
            someColor = etestObject.getColor();
            colorIs(someColor);

            etestObject.setColor(green);
            someColor = etestObject.getColor();
            colorIs(someColor);
          }
          catch(CORBAException e) {
            System.out.println("corba exception raised: ");
            e.printStackTrace();
            System.exit(1);
          }
        }
      }

      The output of the programis as follows

      red
      java.lang.Error: Inconsistent exceptions in invoke: sunw.corba.EnumerationRangeException
              at foo.etestStub.setColor(etestStub.java:67)
              at etestClient.main(etestClient.java:33)

      This seems to be a problem with Joe's handling of server
      side exceptions due to the fact that a java.lang.Error is
      raised because of the incosistency betweem the
      sunw.corba.EnumerationRangeException and the
      java.lang.Exception.

        Attachments

          Activity

            People

            Assignee:
            skrishnasunw Sanjeev Krishnan (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: