Internal Error when using AWT even with headless=true

54 views
Skip to first unread message

Andres

unread,
Aug 25, 2011, 9:46:34 AM8/25/11
to jenkins...@googlegroups.com
Hi Folks,

We just recently turned on our maven test plugin when using Jenkins for our
CI. However we see the following Exception:

java.lang.InternalError: Can't connect to window server - not enough
permissions.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1823)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1720)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
at java.awt.Color.<clinit>(Color.java:263)
at
com.util.culturalsurvey.reports.ReportConstants.<clinit>(ReportConstants.java:411)

In the first test that references ReportConstants, followed by ClassNotFound
in all subsequent tests that reference ReportConstants.

I found

http://jenkins.361315.n4.nabble.com/Maven-jobs-fail-upon-upgrade-to-1-341-quot-Can-t-connect-to-window-server-quot-td1288967.html
and followed the suggestions provided there. However setting
awt.headless=true in all three suggested places (global MAVEN_OPTS, job
specific MAVEN_OPTS, and the Jenkins process itself) did not resolve the
issue.

We are running Jenkins on a Mac OS X as a user.

Any ideas welcome at this point.

Cheers,
Andres

Configuration Details:
awt.nativeDoubleBuffering true
awt.toolkit apple.awt.CToolkit
executable-war /opt/hudson/hudson.war
file.encoding MacRoman
file.encoding.pkg sun.io
file.separator /
ftp.nonProxyHosts local|*.local|169.254/16|*.169.254/16
gopherProxySet false
guice.disable.misplaced.annotation.check true
http.nonProxyHosts local|*.local|169.254/16|*.169.254/16
hudson.diyChunking true
java.awt.graphicsenv apple.awt.CGraphicsEnvironment
java.awt.headless true
java.awt.printerjob apple.awt.CPrinterJob
java.class.path /opt/hudson/hudson.war
java.class.version 50.0
java.endorsed.dirs
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/endorsed
java.ext.dirs
/Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext
java.home /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
java.io.tmpdir /var/folders/20/20rBPPfNE8Kf74LJ3OJoZk++-+U/-Tmp-/
java.library.path
.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
java.runtime.name Java(TM) SE Runtime Environment
java.runtime.version 1.6.0_24-b07-334-10M3326
java.specification.name Java Platform API Specification
java.specification.vendor Sun Microsystems Inc.
java.specification.version 1.6
java.vendor Apple Inc.
java.vendor.url http://www.apple.com/
java.vendor.url.bug http://bugreport.apple.com/
java.version 1.6.0_24
java.vm.info mixed mode
java.vm.name Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name Java Virtual Machine Specification
java.vm.specification.vendor Sun Microsystems Inc.
java.vm.specification.version 1.0
java.vm.vendor Apple Inc.
java.vm.version 19.1-b02-334
jna.platform.library.path /usr/lib:/usr/lib
line.separator
mail.smtp.sendpartial true
mail.smtps.sendpartial true
mrj.build 10M3326
mrj.version 1060.1.6.0_24-334
os.arch x86_64
os.name Mac OS X
os.version 10.6.5
path.separator :
socksNonProxyHosts local|*.local|169.254/16|*.169.254/16
sun.arch.data.model 64
sun.boot.class.path
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsfd.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Resources/Java/JavaRuntimeSupport.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/laf.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/sunrsasign.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar
sun.boot.library.path
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries
sun.cpu.endian little
sun.cpu.isalist
sun.io.unicode.encoding UnicodeLittle
sun.java.launcher SUN_STANDARD
sun.jnu.encoding MacRoman
sun.management.compiler HotSpot 64-Bit Server Compiler
sun.os.patch.level unknown
svnkit.http.methods Digest,Basic,NTLM,Negotiate
svnkit.ssh2.persistent false
svnkit.symlinks false
user.country US
user.dir /
user.home /opt/hudson
user.language en
user.name hudsonclient
user.timezone America/New_York


--
View this message in context: http://jenkins.361315.n4.nabble.com/Internal-Error-when-using-AWT-even-with-headless-true-tp3768281p3768281.html
Sent from the Jenkins users mailing list archive at Nabble.com.

danny staple

unread,
Aug 25, 2011, 9:53:38 AM8/25/11
to jenkins...@googlegroups.com

We used xvfb when having a similar problem.

typed on my phone expect typos...

Andres

unread,
Aug 31, 2011, 12:42:27 PM8/31/11
to jenkins...@googlegroups.com
Turns out that the reason it was failing is that when you run maven test it
spawns into a separate process and that does not pull down the necessary
properties.

We ended up needing to do:
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<parallel>true</parallel>
<threadCount>10</threadCount>
<systemPropertyVariables>
*<java.awt.headless>true</java.awt.headless>*
<log4j.configuration>${runtime.log4j.config}
</log4j.configuration>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>

In the pom.xml to get it to work properly.

--
View this message in context: http://jenkins.361315.n4.nabble.com/Internal-Error-when-using-AWT-even-with-headless-true-tp3768281p3781552.html

Reply all
Reply to author
Forward
0 new messages