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

webstart can't run RMI application: jdk.javaws does not export com.sun.jnlp to module java.rmi

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b116
    • CPU:
      x86_64
    • OS:
      windows_7
    • Verification:
      Verified

      Description

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+111)
      Java HotSpot(TM) Client VM (build 9-ea+111, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Running an RMI application over webstart now breaks, due to incorrect modularisation.

      REGRESSION. Last worked in version 8u77

      ADDITIONAL REGRESSION INFORMATION:
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+111)
      Java HotSpot(TM) Client VM (build 9-ea+111, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Set up and export an RMI service at a well-known address (see example code Server.java)
      1a) javac Server.java
      1b) java -cp . Server
      2. Write a small client to connect to it and deploy over webstart with full permissions (see example code Test.java)
      2a) javac Test.java
      2b) jar mcf allperms-mf test.jar Test.class
      2c) jarsigner test.jar signer-alias
      3. Launch the provided webstart file

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The client should connect with no error (assuming no firewall, etc., etc)
      ACTUAL -
      The client fails to start

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.IllegalAccessError: class java.rmi.server.RMIClassLoader (in module java.rmi) cannot access class com.sun.jnlp.JNLPRMIClassLoaderSpi (in module jdk.javaws) because module jdk.javaws does not export com.sun.jnlp to module java.rmi
      at java.rmi.server.RMIClassLoader.initializeProvider(java.rmi@9-ea/RMIClassLoader.java:689)
      at java.rmi.server.RMIClassLoader.access$000(java.rmi@9-ea/RMIClassLoader.java:110)
      at java.rmi.server.RMIClassLoader$1.run(java.rmi@9-ea/RMIClassLoader.java:120)
      at java.rmi.server.RMIClassLoader$1.run(java.rmi@9-ea/RMIClassLoader.java:119)
      at java.security.AccessController.doPrivileged(java.base@9-ea/Native Method)
      at java.rmi.server.RMIClassLoader.<clinit>(java.rmi@9-ea/RMIClassLoader.java:118)
      at sun.rmi.server.MarshalInputStream.resolveProxyClass(java.rmi@9-ea/MarshalInputStream.java:256)
      at java.io.ObjectInputStream.readProxyDesc(java.base@9-ea/ObjectInputStream.java:1564)
      at java.io.ObjectInputStream.readClassDesc(java.base@9-ea/ObjectInputStream.java:1520)
      at java.io.ObjectInputStream.readOrdinaryObject(java.base@9-ea/ObjectInputStream.java:1779)
      at java.io.ObjectInputStream.readObject0(java.base@9-ea/ObjectInputStream.java:1356)
      at java.io.ObjectInputStream.readObject(java.base@9-ea/ObjectInputStream.java:368)
      at sun.rmi.registry.RegistryImpl_Stub.lookup(java.rmi@9-ea/Unknown Source)
      at java.rmi.Naming.lookup(java.rmi@9-ea/Naming.java:101)
      at Test.main(Test.java:5)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:531)
      at com.sun.javaws.Launcher.executeApplication(jdk.javaws@9-ea/Launcher.java:1780)
      at com.sun.javaws.Launcher.executeMainClass(jdk.javaws@9-ea/Launcher.java:1715)
      at com.sun.javaws.Launcher.doLaunchApp(jdk.javaws@9-ea/Launcher.java:1563)
      at com.sun.javaws.Launcher.run(jdk.javaws@9-ea/Launcher.java:164)
      at java.lang.Thread.run(java.base@9-ea/Thread.java:804)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // Server.java
      import java.rmi.registry.*;
      import java.rmi.server.*;

      public class Server {
              public static void main(String[] args) throws Exception {
                      Registry r = LocateRegistry.createRegistry(1099);
                      r.bind ("Toto", new UnicastRemoteObject () {});
              }
      }

      // Test.java
      import java.rmi.Naming;

      public class Test {
              public static void main(String[] args) throws Exception {
                      Naming.lookup("rmi://testmachine:1099/Toto");
              }
      }

      // test.jnlp
      ?xml version="1.0" encoding="utf-8"?>
      <jnlp spec="6.0+" codebase="http://www.example.com/webstart" href="test.jnlp">
        <security>
            <all-permissions/>
        </security>
        <resources>
          <j2se version="1.8+" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="64m" max-heap-size="384m" java-vm-args="-ea"/>
          <jar href="test.jar" main="true"/>
        </resources>
        <application-desc main-class="Test"/>
      </jnlp>

      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              almatvee Alexander Matveev
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: