UrlClassLoader ClassCastException

issue-acknowledged
gradle-3565

(blackdrag) #1

Hi from the Groovy Project again,

Using ca9d78a72a1e76e9 from the JDK9 repository I get the following exception when trying to start gradle 3.0 on our CI server:

[22:28:49][Step 2/3] Starting a Gradle Daemon, 2 busy and 1 incompatible Daemons could not be reused, use --status for details
[22:28:51][Step 2/3] :buildSrc:clean UP-TO-DATE[22:28:51][Step 2/3] :buildSrc:compileJava UP-TO-DATE
[22:28:52][Step 2/3] :buildSrc:compileGroovy[22:28:52][Step 2/3] Error occurred during initialization of VM[22:28:52]
[Step 2/3] java.lang.ClassCastException: jdk.internal.loader.ClassLoaders$AppClassLoader (in module: java.base) cannot be cast to java.net.URLClassLoader (in module: java.base)
[22:28:52][Step 2/3] 	at worker.org.gradle.process.internal.worker.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:60)
[22:28:52][Step 2/3] 	at java.lang.SecurityManager.checkPropertyAccess(java.base@9-internal/SecurityManager.java:1292)
[22:28:52][Step 2/3] 	at java.lang.System.getProperty(java.base@9-internal/System.java:761)
[22:28:52][Step 2/3] 	at java.lang.ClassLoader.initSystemClassLoader(java.base@9-internal/ClassLoader.java:1709)
[22:28:52][Step 2/3] 	at java.lang.System.initPhase3(java.base@9-internal/System.java:1979)
[22:28:52][Step 2/3] 
[22:28:52][Step 2/3] :buildSrc:compileGroovy FAILED
[22:28:52][Step 2/3] :buildSrc:processResources UP-TO-DATE
[22:28:52][Step 2/3] :buildSrc:processTestResources UP-TO-DATE
[22:28:52][Step 2/3] 
[22:28:52][Step 2/3] 
[22:28:52][Step 2/3] BUILD FAILED
[22:28:52][Step 2/3] 
[22:28:52][Step 2/3] Total time: 3.723 secs
[22:28:52][Step 2/3] ##teamcity[buildProblem identity='1909892886' description='Execution failed for task |':compileGroovy|'. org.gradle.process.internal.worker.WorkerProcessException: Failed to run Gradle Compiler Daemon' type='gradleBuildProblem']

Since that part of the code is basically unchanged for a long time and since the ClassCastException problem was already “solved” in gradle I can only assume, that something supposed to recognize JDK9 is not working for this snapshot build.


(Jendrik Johannes) #2

Thanks for reporting. Opened: https://issues.gradle.org/browse/GRADLE-3565