java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class Test

Coderanch | meeta gaur | 3 years ago
  1. 0

    Cloneable

    Coderanch | 3 years ago | meeta gaur
    java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class Test
  2. 0

    Why does this Scala code throw IllegalAccessError at runtime?

    Stack Overflow | 4 years ago | Mechanical snail
    java.lang.IllegalAccessError: tried to access field Test$.reflParams$Cache1 from class Test$delayedInit$body
  3. 0

    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 ----------

    JDK Bug System | 9 months ago | Webbug Group
    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)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    tried to access method java.lang.Object.clone()Ljava/lang/Object; from class ar.com.fdvs.dj.util.Utils

    Stack Overflow | 3 years ago | Nauman Rafique
    java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang /Object; from class ar.com.fdvs.dj.util.Utils
  6. 0

    install.db.schema: IllegalAccessError

    xplanner | 1 decade ago | n-space
    java.lang.IllegalAccessError: tried to access method java.lang.Object.clone()Ljava/lang/Object; from class org.apache.xerces.impl.XMLEntityManager

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalAccessError

      tried to access method java.lang.Object.clone()Ljava/lang/Object; from class Test

      at Test.main()
    2. Unknown
      Test.main
      1. Test.main(Test.java:15)
      1 frame