Test jvmArgs don't work in rc-3 like they did in milestone-9


(Klaus Baumgartner) #1

Help,

I’ve been using gradle version milestone-9. Recently I had to update to get a (pmd plugin related) bug fixed.

After updating I discovered that the test.jvmArgs don’t work in rc-3 like they did in milestone-9.

Here is the test configuration in my build.gradle:

test {

jvmArgs ‘-Xmx512m’,

‘-Djava.security.manager’,

‘-Dpolicy.provider=sun.security.provider.PolicyFile’,

‘-Djava.security.policy=…/java.policy’

ignoreFailures true }

It works fine when I run the build with milestone-9 (and did with some previous versions). When I use rc-3 instead, I get the stacktrace below.

You can contact me any time in case you need further input.

Thanks in advance, Klaus

mbk:turnins klaus$ gradle :group00:test :group00:compileJava UP-TO-DATE :group00:processResources UP-TO-DATE :group00:classes UP-TO-DATE :group00:compileTestJava UP-TO-DATE :group00:processTestResources UP-TO-DATE :group00:testClasses UP-TO-DATE :group00:test Error occurred during initialization of VM java.lang.ExceptionInInitializerError

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.RuntimeException: Could not create an instance of ‘’ specified for system SecurityManager.

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:88)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)

at java.lang.System.getProperty(System.java:706)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.ClassNotFoundException:

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:85)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)

at java.lang.System.getProperty(System.java:706)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468)

Could not write process standard input. java.io.IOException: Broken pipe

at java.io.FileOutputStream.writeBytes(Native Method)

at java.io.FileOutputStream.write(FileOutputStream.java:318)

at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)

at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)

at org.gradle.process.internal.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:51)

at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722) Error occurred during initialization of VM java.lang.ExceptionInInitializerError

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.RuntimeException: Could not create an instance of ‘’ specified for system SecurityManager.

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:88)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)

at java.lang.System.getProperty(System.java:706)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.ClassNotFoundException:

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:85)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302) Could not write process standard input. java.io.IOException: Broken pipe

at java.io.FileOutputStream.writeBytes(Native Method)

at java.io.FileOutputStream.write(FileOutputStream.java:318)

at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)

at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)

at org.gradle.process.internal.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:51)

at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

at java.lang.System.getProperty(System.java:706) Gradle Worker 2 finished with (non-zero) exit value 1. org.gradle.process.internal.ExecException: Gradle Worker 2 finished with (non-zero) exit value 1.

at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:339)

at org.gradle.process.internal.DefaultWorkerProcess.onProcessStop(DefaultWorkerProcess.java:78)

at org.gradle.process.internal.DefaultWorkerProcess.access$000(DefaultWorkerProcess.java:31)

at org.gradle.process.internal.DefaultWorkerProcess$1.executionFinished(DefaultWorkerProcess.java:51)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:88)

at org.gradle.messaging.dispatch.BroadcastDispatch.dispatch(BroadcastDispatch.java:32)

at org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:132)

at org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)

at org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:72)

at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468)

Error occurred during initialization of VM java.lang.ExceptionInInitializerError

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.RuntimeException: Could not create an instance of ‘’ specified for system SecurityManager.

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:88)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)

at java.lang.System.getProperty(System.java:706)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Caused by: java.lang.ClassNotFoundException:

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

at org.gradle.process.internal.child.BootstrapSecurityManager.checkPermission(BootstrapSecurityManager.java:85)

at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1302)

at java.lang.System.getProperty(System.java:706)

at sun.misc.Launcher.(Launcher.java:58)

at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1486)

at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1468) Could not write process standard input. java.io.IOException: Broken pipe

at java.io.FileOutputStream.writeBytes(Native Method)

at java.io.FileOutputStream.write(FileOutputStream.java:318)

at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)

at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)

at org.gradle.process.internal.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:51)

at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722) [and so on…]


(Adam Murdoch) #2

I’ve added this as GRADLE-2280.


(Adam Murdoch) #3

A workaround would be to use ‘-Djava.security.manager=java.lang.SecurityManager’ instead of the empty ‘-Djava.security.manager’.


(Klaus Baumgartner) #4

Nice workaround, works. (Why didn’t I think of that?)

Thanks a lot for the quick response, Klaus