Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6604044
Votes 5
Synopsis java crashes talking to second X screen
Category java:classes_2d
Reported Against 06 , b04 , b06 , b12 , snv_74 , solaris
Release Fixed 7(b28), 6u10(b22) (Bug ID:2160635) , 6-open(b10) (Bug ID:2161024)
State 10-Fix Delivered, Verified, bug
Priority: 2-High
Related Bugs 6599351 , 6689390 , 6691767 , 6821892
Submit Date 12-SEP-2007
Description
The vino-client java VNC client crashes when DISPLAY is set to the second head of my desktop:

  xxxxx@xxxxx  > cat `which vncviewer`
#!/bin/sh
exec java -jar /usr/share/gnome/vino/vino-client.jar ${1+"$@"}
  xxxxx@xxxxx  > 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)
  xxxxx@xxxxx  > 

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

  xxxxx@xxxxx  > 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>
Posted Date : 2007-09-12 23:46:52.0
Work Around
Use the first screen of your X server.
Evaluation
Setup dual monitor envrionment both on sparc and x86, could not reproduce this bug.
Attach my x86 xorg.conf for your referrence.
Posted Date : 2007-09-13 03:54:48.0

Halton,

You're using xinerama. Try turning that off. Then try running a java app with DISPLAY set to :0.1
Posted Date : 2008-03-25 18:09:06.0

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.
Posted Date : 2008-03-27 18:51:44.0
Comments
  
  Include a link with my name & email   

Submitted On 04-FEB-2008
michalsc
I can confirm that this bug still occurs on jdk 1.6.0_03. My setup uses two screens numbered as :0.0 and :0.1 without xinerama. Every Swing/AWT app crashes when started on screen :0.1

xxx@xxx:~> java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)

xxx@xxx:~> ControlPanel
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at java.awt.Toolkit$2.run(Toolkit.java:836)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:828)
        at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:120)
        at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:130)
        at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1591)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:577)
        at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1331)
        at javax.swing.UIManager.initialize(UIManager.java:1418)
        at javax.swing.UIManager.maybeInitialize(UIManager.java:1406)
        at javax.swing.UIManager.getLookAndFeel(UIManager.java:490)
        at com.sun.deploy.util.DeployUIManager.setLookAndFeel(DeployUIManager.java:84)
        at com.sun.deploy.panel.ControlPanel.<clinit>(ControlPanel.java:33)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at sun.awt.X11GraphicsEnvironment.getDefaultScreenDevice(X11GraphicsEnvironment.java:218)
        at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:91)


And the same (ArrayIndexOutOfBoundsException at getDefaultScreenDevice) for every other Swing/AWT app. The applications which use SWT toolkit do work properly.


Submitted On 20-FEB-2008
arother
This still occurs on java version "1.6.0_04". It crashes on every screen except :0.0


Submitted On 28-OCT-2008
TrickyP
Under Ubuntu 8.04, fully updated on today's date:



>> java -version

java version "1.6.0_07"

Java(TM) SE Runtime Environment (build 1.6.0_07-b06)

Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

>> 

>> jedit

[error] main: Exception in thread "main" 

[error] main: java.lang.ArrayIndexOutOfBoundsException: 1

[error] main:  at sun.awt.X11GraphicsEnvironment.getDefaultScreenDevice(X11GraphicsEnvironment.java:218)

[error] main:  at sun.font.FontDesignMetrics.getDefaultFrc(FontDesignMetrics.java:135)

[error] main:  at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:259)

[error] main:  at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:954)

[error] main:  at javax.swing.JComponent.getFontMetrics(JComponent.java:1597)

[error] main:  at org.gjt.sp.jedit.gui.SplashScreen.<init>(SplashScreen.java:39)

[error] main:  at org.gjt.sp.jedit.GUIUtilities.showSplashScreen(GUIUtilities.java:1519)

[error] main:  at org.gjt.sp.jedit.jEdit.main(jEdit.java:299)



Submitted On 28-MAY-2009
this bug is NOT FIXED

still present in 1.6.0_12

$ java -version
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) 64-Bit Server VM (build 11.2-b01, mixed mode)


Submitted On 29-MAY-2009
dmitri_trembovetski
Need more info than that. For example, a stack trace,  the specific configuration details, etc.


Submitted On 17-JUN-2009
thiago-dev
This bug happens in all vesions of plataform >= 1.5. Happens when any graphical object is instantiated in any else X WINDOW screen diferent of :0.0.

Here is a log:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
        at sun.awt.X11GraphicsEnvironment.getDefaultScreenDevice(X11GraphicsEnvironment.java:178)
        at java.awt.Window.init(Window.java:271)
        at java.awt.Window.<init>(Window.java:319)


The method "getDefaultScreenDevice" return a array with a position ([0]), and in 1.6.0_13 plataform return 2 positions ([0,1]).

Please solve this problem.


Submitted On 17-JUN-2009
thiago-dev
Please, this bug need be also fixed in 1.5 plataform the same way as was done for 1.6 (mustang).


Submitted On 22-JUN-2009
dmitri_trembovetski
1.5 is no longer supported unless you have a support contract. Please upgrade to 1.6.



PLEASE NOTE: JDK6 is formerly known as Project Mustang