[GRADLE-2280] test jvmArgs don't work in rc-3 like they did in milestone-9 Created: 07/May/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 3


 Description   

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



 Comments   
Comment by Richard Murray [ 01/Nov/13 ]

I found a similar issue using Gradle 1.8 - with vmargs on a test task - see forum post http://forums.gradle.org/gradle/topics/java_lang_internalerror_could_not_create_securitymanager_jarjar_org_gradle_process_internal_child_bootstrapsecuritymanager

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:17:38 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.