JDK-6604044 : java crashes talking to second X screen
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version:
    solaris,solaris_11,4.2,5.0u12,6,6u1,6u3,6u4 solaris,solaris_11,4.2,5.0u12,6,6u1,6u3,6u4
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris_nevada,solaris_10
  • CPU: generic,x86,sparc
  • Submitted: 2007-09-12
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u10Fixed 7 b28Fixed OpenJDK6Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
The vino-client java VNC client crashes when DISPLAY is set to the second head of my desktop:

rab@loris> cat `which vncviewer`
#!/bin/sh
exec java -jar /usr/share/gnome/vino/vino-client.jar ${1+"$@"}
rab@loris> DISPLAY=:0.1 vncviewer :0
java.lang.ArrayIndexOutOfBoundsException: 1
        at sun.awt.X11GraphicsEnvironment.getDefaultScreenDevice(X11GraphicsEnvironment.java:218)
        at java.awt.Window.init(Window.java:354)
        at java.awt.Window.<init>(Window.java:407)
        at java.awt.Frame.<init>(Frame.java:402)
        at java.awt.Frame.<init>(Frame.java:367)
        at vncviewer.Dialog.<init>(Dialog.java:34)
        at vncviewer.OptionsDialog.<init>(OptionsDialog.java:30)
        at vncviewer.CConn.<init>(CConn.java:95)
        at vncviewer.VNCViewer.run(VNCViewer.java:151)
        at java.lang.Thread.run(Thread.java:619)
Exception in thread "Thread-1" java.lang.ArrayIndexOutOfBoundsException: 1
        at sun.awt.X11GraphicsEnvironment.getDefaultScreenDevice(X11GraphicsEnvironment.java:218)
        at java.awt.Window.init(Window.java:354)
        at java.awt.Window.<init>(Window.java:407)
        at java.awt.Frame.<init>(Frame.java:402)
        at java.awt.Frame.<init>(Frame.java:367)
        at vncviewer.Dialog.<init>(Dialog.java:34)
        at vncviewer.MessageBox.<init>(MessageBox.java:30)
        at vncviewer.MessageBox.<init>(MessageBox.java:61)
        at vncviewer.VNCViewer.run(VNCViewer.java:163)
        at java.lang.Thread.run(Thread.java:619)
rab@loris> 

But it works when DISPLAY is set to the first screen:

rab@loris> DISPLAY=:0.0 vncviewer :0 
Java Accessibility Bridge for GNOME loaded.

CConn: connected to host localhost port 5900
CConnection: Server supports RFB protocol version 3.3
CConnection: Using RFB protocol version 3.3
CConn: Using pixel format depth 24 (32bpp) big-endian rgb888
CConn: Using ZRLE encoding
<it works>

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/7/6604044.0
14-05-2008

EVALUATION I have successfully tested the fix on Linux and (with help from interested parties) on solaris. The fix is to check if the number of screens reported by XineramaGetInfo is greater than reported by XScreenCount and only enable xinerama support if that's the case.
27-03-2008

EVALUATION Halton, You're using xinerama. Try turning that off. Then try running a java app with DISPLAY set to :0.1
25-03-2008

EVALUATION Setup dual monitor envrionment both on sparc and x86, could not reproduce this bug. Attach my x86 xorg.conf for your referrence.
13-09-2007

WORK AROUND Use the first screen of your X server.
12-09-2007