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

Alternate APIs for sun.rmi classes scheduled for removal in a future release.

    Details

    • Subcomponent:
    • Introduced In Version:
      9
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      OS: Windows 7 64 bit.
      Java version: 10.0.1


      A DESCRIPTION OF THE PROBLEM :
      Currently, JDK 10.0.1 allows to make use of the below listed internal APIs with a warning message like "warning: UnicastRef is internal proprietary API and may be removed in a future release."
      1) sun.rmi.server.UnicastRef
      2) sun.rmi.server.UnicastRef2
      3) sun.rmi.transport.Endpoint
      4) sun.rmi.transport.LiveRef
      5) sun.rmi.transport.tcp.TCPEndpoint

      The question is that, Is Oracle going to provide an alternate solution/classes for the above listed internal APIs, If the above internal APIs are going to be removed?

      The internal APIs listed above have been used in an application developed 15+ years back. Now, the aim is to migrate the application from JDK 8 u171 to JDK 11.

      REGRESSION : Last worked in version 8u172

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Step 1) Write a below java code:

      import sun.rmi.server.UnicastRef;
      import sun.rmi.server.UnicastRef2;
      import sun.rmi.transport.Endpoint ;
      import sun.rmi.transport.LiveRef ;
      import sun.rmi.transport.tcp.TCPEndpoint;
      public class HelloWorld {

      }

      Step 2) compile the java code using JDK 10.0.1 as below:

      javac --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED HelloWorld.java


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      java code should compile without any warning message like "warning: UnicastRef is internal proprietary API and may be removed in a future release".
      ACTUAL -
      warning: UnicastRef is internal proprietary API and may be removed in a future release.

      CUSTOMER SUBMITTED WORKAROUND :
      Make use of "--add-exports" command to export sun.rmi.server package during compilation.

      command:
      javac --add-exports java.rmi/sun.rmi.server=ALL-UNNAMED --add-exports java.rmi/sun.rmi.transport=ALL-UNNAMED --add-exports java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED HelloWorld.java

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              smarks Stuart Marks
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: