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

rmic -iiop gen. fails when interface throws super class of impl exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • other-libs
    • beta3
    • x86
    • windows_nt



      Name: boT120536 Date: 06/24/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      When rmic is run on a file with the iiop parameters that throws a subclass of
      an exception that is defined in an interface, the tie generation fails to find
      the specfied class and results in the following error: } catch (null ex) {

      Where catch(null ex) should be replaced by catch(myException ex). Code
      generation then fails.

      Save the following .java files to their appropriate directories:

      package com.first.exceptions;
      public class BaseException extends Exception{
          public BaseException(){
              super();
          }
      }

      package com.first;
      import com.first.exceptions.BaseException;
      public class Exception2Level extends BaseException{
          public Exception2Level(){
              super();
          }
      }

      package com.first;
      public class Exception3Level extends Exception2Level{
          public Exception3Level (){
              super();
          }
      }


      package com.second.api;

      import java.rmi.*;
      import java.util.*;
      import com.first.Exception2Level;

      public interface TestInterface extends Remote {
          public void throwException2LevelFromInterface() throws
      com.first.Exception2Level, RemoteException;
      }


      package com.second.impl;
      import java.rmi.*;
      import com.second.api.TestInterface;
      import com.first.Exception3Level;
      public class TestImpl implements TestInterface {

          public TestImpl() throws Exception3Level, RemoteException {
              // blah blah blah

          }
          public void throwException2LevelFromInterface() throws
      com.first.Exception3Level, RemoteException {
              try{
                  if(1!=0){
                  }
              } catch(Exception e){
                  throw new Exception3Level();
              }
          }
      }


      Then compile all classes

      Run the command with the j2ee.jar file in the classpath

      rmic -iiop -always -keep -verbose -classpath .;j2ee.jar
      com.second.impl.TestImpl -d .

      You should receive the following error:

      [loaded .\com\second\impl\TestImpl.class in 0 ms]
      [loaded .\com\second\api\TestInterface.class in 15 ms]
      [loaded .\com\first\Exception3Level.class in 0 ms]
      [loaded .\com\first\Exception2Level.class in 0 ms]
      [loaded .\com\first\exceptions\BaseException.class in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/String.class) in 16 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/Comparable.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/PrintStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/FilterOutputStream.class) in
      0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/OutputStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/PrintWriter.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/Writer.class) in 0 ms]
      [generated .\com\second\impl\_TestImpl_Tie.java in 0 ms]
      [parsed .\com\second\impl\_TestImpl_Tie.java in 390 ms]
      [generated .\com\second\api\_TestInterface_Stub.java in 16 ms]
      [parsed .\com\second\api\_TestInterface_Stub.java in 31 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(javax/rmi/CORBA/Tie.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(javax/rmi/CORBA/Util.class) in 15 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/BAD_OPERATION.class) in0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/ORB.class) in 16 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/SystemException.class)in 16 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/InputStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/OutputStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/ResponseHandler.class) in 15 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/UnknownException.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA_2_3/portable/ObjectImpl.class) in 16 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/ObjectImpl.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/InvokeHandler.class) in 0 ms]
      [checking class com.second.impl._TestImpl_Tie]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/io/InputStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA_2_3/portable/InputStream.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA_2_3/portable/OutputStream.class) in 0 ms]
      .\com\second\impl\_TestImpl_Tie.java:67: Invalid type expression.
                      } catch (null ex) {
                               ^
      .\com\second\impl\_TestImpl_Tie.java:72: Invalid type expression.
                          out.write_value(ex,null.class);
                                             ^
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/rmi/UnexpectedException.class)
      in 16 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(javax/rmi/CORBA/Stub.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/ApplicationException.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/RemarshalException.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/ServantObject.class) in 0 ms]
      [checking class com.second.api._TestInterface_Stub]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/Class.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(org/omg/CORBA/portable/BoxedValueHelper.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/ClassNotFoundException.class) in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/NoClassDefFoundError.class)in 0 ms]
      [loaded D:\java\j2sdk1.3.0\jre\lib\rt.jar(java/lang/LinkageError.class) in 0 ms]

      [wrote .\com\second\api\_TestInterface_Stub.class]
      2 errors
      [done in 1812 ms]
      (Review ID: 126614)
      ======================================================================

            sbauersunw Stefan Bauer (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: