Search code examples
awtjava-8headlesshp-uxxserver

Geting java.awt.AWTError: Can't connect to X11 window server on HP-unix with JRE-8


on running the GUI based java application using JRE 8 on HP-UX I am getting the following error:

Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'ravkumar-t430.apac.tibco.com:1.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$300(X11GraphicsEnvironment.java:65)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:126)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:79)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
        at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:123)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.Toolkit$2.run(Toolkit.java:861)
        at java.awt.Toolkit$2.run(Toolkit.java:856)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:855)
        at sun.swing.SwingUtilities2.getSystemMnemonicKeyMask(SwingUtilities2.java:2020)
        at javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(BasicLookAndFeel.java:1158)
        at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:431)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
        at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:579)
        at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1356)
        at javax.swing.UIManager.initialize(UIManager.java:1466)
        at javax.swing.UIManager.maybeInitialize(UIManager.java:1433)
        at javax.swing.UIManager.getDefaults(UIManager.java:666)
        at com.tibco.administrator.wizard.WizardDialog.setUIFont(WizardDialog.java:208)
        at com.tibco.administrator.du.DomainUtility.a(DomainUtility.java:616)
        at com.tibco.administrator.du.DomainUtility.main(DomainUtility.java:450)

But once I use the JRE 7 instead of JRE 8 then issue resolves and application comes up fine.

When I set the java.awt.headless=true property in the application then it gives the java.awt.headless exception.

Please suggest me the solution.


Solution

  • It's a bug in the HP-UX operating system which creates issues with X11 displays with 64 bit JRE. This issue is resolved after installing the latest OS patch PHSS_43291.

    http://h20564.www2.hp.com/hpsc/doc/public/display?docId=pdb_na-PHSS_43291&sp4ts.oid=3367737

    There are two solutions to this issue:

    1/ Either switch to 32 bit jre

    2/ Install latest patch on 11.31.