-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
11.0.6
ADDITIONAL SYSTEM INFORMATION :
Affects all environments using Java 11.0.6
A DESCRIPTION OF THE PROBLEM :
Our application has two interfaces a simple interface 'A' with various methods defined and another interface 'ARemote' which extends 'A' and 'Remote'. The intent is that all Remote implementations implement 'ARemote' while non-Remote implementation implement 'A'. With the recent Remote interface enforcement change made to RemoteObjectInvocationHandler all of the methods inherited from 'ARemote' but declared in 'A' fail this new Remote interface check.
Introduced by rriggs with OpenJDK commit "8230967: Improve Registry support of clients" (changeset 57696:bf6bb6ddbda3)
REGRESSION : Last worked in version 11
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Complete setup of RMI client/server is rather involved so I am attempting to keep things simple.
Create an interface (e.g., 'ARemote') which extends a non-Remote interface (e.g., 'A') and 'Remote'. Create an class which implements this interface (e.g., 'ARemoteImpl'). When this implementation is instantiated and remote invocations are made to the methods inherited (e.g., from interface 'A') a RemoteException occurs indicating the "Method is not Remote" even though that method is declared on the remote interface.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
If a an interface (e.g., 'ARemote') extends 'Remote' together with other interfaces (e.g., 'A'), all inherited methods should be treated as Remote by implementations of the declared interface (e.g., 'ARemoteImpl').
ACTUAL -
If a an interface (e.g., 'ARemote') extends 'Remote' together with other interfaces, NONE of the inherited methods are treated as Remote by implementations of the declared interface. Attempts to access such methods result in a RemoteException thrown by RemoteObjectInvocationHandler:
throw new RemoteException("Method is not Remote: " + decl + "::" + method);
---------- BEGIN SOURCE ----------
public interface A {
int getValue();
}
-----
public interface ARemote extends A, Remote {
}
------
public class ARemoteImpl extends UnicastRemoteObject implements ARemote {
public ARemote() {
}
public int getValue() {
return 123;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Work around is to override all methods declared in top-level interfaces (e.g., 'A') into the extended Remote interfaces (e.g., 'ARemote'). Although, this become a maintenance issue since failing to override a method will not produce a compile error but will produce a RemoteException when remote invocations of such methods occur.
FREQUENCY : always
Affects all environments using Java 11.0.6
A DESCRIPTION OF THE PROBLEM :
Our application has two interfaces a simple interface 'A' with various methods defined and another interface 'ARemote' which extends 'A' and 'Remote'. The intent is that all Remote implementations implement 'ARemote' while non-Remote implementation implement 'A'. With the recent Remote interface enforcement change made to RemoteObjectInvocationHandler all of the methods inherited from 'ARemote' but declared in 'A' fail this new Remote interface check.
Introduced by rriggs with OpenJDK commit "8230967: Improve Registry support of clients" (changeset 57696:bf6bb6ddbda3)
REGRESSION : Last worked in version 11
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Complete setup of RMI client/server is rather involved so I am attempting to keep things simple.
Create an interface (e.g., 'ARemote') which extends a non-Remote interface (e.g., 'A') and 'Remote'. Create an class which implements this interface (e.g., 'ARemoteImpl'). When this implementation is instantiated and remote invocations are made to the methods inherited (e.g., from interface 'A') a RemoteException occurs indicating the "Method is not Remote" even though that method is declared on the remote interface.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
If a an interface (e.g., 'ARemote') extends 'Remote' together with other interfaces (e.g., 'A'), all inherited methods should be treated as Remote by implementations of the declared interface (e.g., 'ARemoteImpl').
ACTUAL -
If a an interface (e.g., 'ARemote') extends 'Remote' together with other interfaces, NONE of the inherited methods are treated as Remote by implementations of the declared interface. Attempts to access such methods result in a RemoteException thrown by RemoteObjectInvocationHandler:
throw new RemoteException("Method is not Remote: " + decl + "::" + method);
---------- BEGIN SOURCE ----------
public interface A {
int getValue();
}
-----
public interface ARemote extends A, Remote {
}
------
public class ARemoteImpl extends UnicastRemoteObject implements ARemote {
public ARemote() {
}
public int getValue() {
return 123;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Work around is to override all methods declared in top-level interfaces (e.g., 'A') into the extended Remote interfaces (e.g., 'ARemote'). Although, this become a maintenance issue since failing to override a method will not produce a compile error but will produce a RemoteException when remote invocations of such methods occur.
FREQUENCY : always
- duplicates
-
JDK-8237213 8u241 requires that the interface extends Remote.
-
- Closed
-