The interwebs all claimed setting
-Djava.awt.headless=true
would resolve the issue but it did nothing for us. We set it as a Jenkins system parameter, in the launchctl job, in the bash_profile of the Jenkins user on the machine, and everywhere we could in the Jenkins job itself....to no avail.Just before heading down the path of setting it programatically somewhere in our test stack - I noticed that our maven-surefire-plugin was configured to use a threadCount of 10. On a hunch that maven-surefire-plugin was not exporting my system properties to the new threads it spawned for the test run - I configured the plugin to set java.awt.headless with the following snip from our pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<excludes>
<exclude>**/TestInstanceBakerTest.java</exclude>
<exclude>**/ExpectedAnswerGeneratorTest.java</exclude>
<exclude>**/ClientNukeTest.java</exclude>
<exclude>**/TestInstanceBank.java</exclude>
</excludes>
<parallel>true</parallel>
<threadCount>10</threadCount>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
<log4j.configuration>${runtime.log4j.config}</log4j.configuration>
</systemPropertyVariables>
</configuration></plugin>