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

8u241 requires that the interface extends Remote.

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Java 1.8.0.241


      A DESCRIPTION OF THE PROBLEM :
      We have a base interface that is by default not Remote (for security related things)
      but we have a interface above that doing:
      RemoteXxxxInterface extends XxxxIntereface, Remote

      to make it really remote

      And we have 2 different kind of classes 1 just extending the XxxxInterface only and 1 really being a remote class that extends the RemoteXxxxInterface and that one we export as a remote

      But now we suddenly get:
      Method is not Remote: interface XxxxInterface ::public abstract java.util.List someMethod(int) at the client side
      But that method is remote because the object is really a RemoteXxxxInterface implementation that is exported. The methods are in a super interface and those suddenly are not callable anymore

      It worked fine until 1.8.241 for years. And suddenly this is broken




      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      if you Run server and then Run the client it will reproduce.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      That the remote method can be called

      ACTUAL -
      Exception in thread "main" java.rmi.RemoteException: Method is not Remote: interface rmi.test.shared.IBaseInterface::public abstract int rmi.test.shared.IBaseInterface.getMyInt(int) throws java.rmi.RemoteException
      at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
      at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
      at com.sun.proxy.$Proxy0.getMyInt(Unknown Source)
      at rmi.test.client.Client.main(Client.java:16)


      ---------- BEGIN SOURCE ----------
      public interface IBaseInterface {
      public int getMyInt(int value) throws RemoteException;
      }

      public interface IRemoteInterface extends Remote, IBaseInterface{

      }

      public class RemoteObject implements IRemoteInterface {

      @Override
      public int getMyInt(int value) {
      return value;
      }
      }

      public class Server {

      public static void main(String[] args) throws RemoteException, AlreadyBoundException, InterruptedException {
      Registry reg = LocateRegistry.createRegistry(1099);
      RemoteObject obj = new RemoteObject();
      UnicastRemoteObject.exportObject(obj, 1099);
      reg.bind("remote", obj);
      synchronized (Server.class) {
      Server.class.wait();
      }
      }
      }

      public class Client {
      public static void main(String[] args) throws RemoteException, NotBoundException {
      Registry registry = LocateRegistry.getRegistry(1099);
      IRemoteInterface lookup = (IRemoteInterface) registry.lookup("remote");
      System.err.println(lookup.getMyInt(10));
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      the work around is to make our base interface also extends Remote
      Problem is this is already for years in the field in products so all of those are suddenly broken and they can't use java 8_241


      FREQUENCY : always


            rriggs Roger Riggs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: