JDK-4092486 : rmic can generate code that will not compile with javac
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 1.1.4
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_95
  • CPU: x86
  • Submitted: 1997-11-13
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2fcsFixed
Related Reports
Relates :  
Description

Name: bk70084			Date: 11/12/97


'rmic' can't compile correctly, if one or more
methods of remote server throw exceptions,
that extend Throwable class. If they extend
Exception class, all Ok.
I don't know, is this a bug?
But it is very strange.

(1) javac SampleServer.java
(2) rmic SampleServer

Output:
I/O exception
I/O exception
2 errors


//----------------------SampleServer.java-----------------
 import java.rmi.*;
 import java.rmi.server.*;

 class SampleException extends Throwable{
     SampleException(){}
 }

 interface SampleInterface extends Remote{
    public void f() throws RemoteException, SampleException;
 }

 class SampleServer extends UnicastRemoteObject implements SampleInterface{
    public SampleServer() throws RemoteException{}
    public void f() throws RemoteException, SampleException{}
 }

(Review ID: 19664)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2fcs INTEGRATED IN: 1.2fcs
14-06-2004

EVALUATION peter.jones@East 1997-11-13 The following two bugs: - that rmic generates erroneous code for stubs if a remote interface method throws a subclass of Throwable other than Exception (or Error) - that if rmic produces code that does not compile, it prints "I/O Exception" instead of the correct javac error (unless "-keepgenerated" is used) are already fix in JDK 1.2 beta2. rmic still generates bad skeleton code if a remote method in an implementation class throws a non-Exception Throwable, because it doesn't catch such Throwables when the method is invoked, and the dispatch() method only declares that it throws Throwable. rmic should notice this problem and generate its own error message, instead of letting javac give a more obscure one. Actually allowing this behavior is the subject of a more significant RFE, because the underlying RMI infrastructure does not support marshalling exceptions form RMI calls other then those of type Exception. peter.jones@East 1998-06-18 For 1.2 FCS, rmic now notices if an implementation declares a remote method that throws a Throwable that it not a subclass of Exception and prints out its own error message, instead of generating invalid Java code and letting javac print its own confusing error messages.
11-06-2004

WORK AROUND Name: bk70084 Date: 11/12/97 ======================================================================
11-06-2004