|
From: Lidia M. <li...@su...> - 2009-09-30 18:33:44
|
Hello
I'm facing an issue when executing HtmlImage.getHeight() on Mac. I'm
using this API in order to test image size. The test fails with the
following exception on Mac:
[java] Exception in thread "main" java.lang.InternalError: Can't connect
to window server - not enough permissions.
[java] at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[java] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822)
[java] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723)
[java] at java.lang.Runtime.loadLibrary0(Runtime.java:823)
[java] at java.lang.System.loadLibrary(System.java:1030)
[java] at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.java2d.Disposer.<clinit>(Disposer.java:40)
[java] at
javax.imageio.stream.FileCacheImageInputStream.<init>(FileCacheImageInputStream.java:88)
[java] at
com.sun.imageio.spi.InputStreamImageInputStreamSpi.createInputStreamInstance(InputStreamImageInputStreamSpi.java:51)
[java] at
javax.imageio.ImageIO.createImageInputStream(ImageIO.java:331)
[java] at
com.gargoylesoftware.htmlunit.html.HtmlImage.readImageIfNeeded(HtmlImage.java:362)
[java] at
com.gargoylesoftware.htmlunit.html.HtmlImage.getHeight(HtmlImage.java:291)
[java] at
com.sun.asqe.jsf.jsf2_0.resource.caching.VerifyApplication.main(VerifyApplication.java:153)
[java] Java Result: 1
I've searched online and the solution seemed to be adding java command
line option "-Djava.awt.headless=true". Thus I added the following
system property to the Mac execution:
<java
classname="com.sun.asqe.jsf.jsf2_0.resource.caching.DeveloperStageCa
chingTests" fork="yes">
<classpath path="${runtime-classpath}"/>
<sysproperty key="java.awt.headless" value="${run-headless}"/>
<arg value="${http.host}"/>
<arg value="${http.port}"/>
However, I still get the same exception. Is there a way around it? The
tests work fine on other unix platforms.
Thanks
Lidia
|