Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-5474

java.awt.AWTError when running status command on system without X11

    Details

    • Type: Bug
    • Status: Done
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.2, 3.5.3
    • Fix Version/s: 6.0.0
    • Component/s: tools
    • Labels:
    • Story Points:
      0

      Description

      Found using OpenDJ 5.5.2 revision 6e236778e2c

      Running status command in a docker container without X11 started we get:

      $ ./opendj/bin/status -D "cn=myself" -w password -n -X     
      11:44:41.738    WARN    ERROR:
      -- rc --
      returned 1, expected [0]
      -- stdout --
      
      -- stderr --
      Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable.
          at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
          at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
          at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:264)
          at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
          at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
          at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:126)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:264)
          at java.awt.Toolkit$2.run(Toolkit.java:860)
          at java.awt.Toolkit$2.run(Toolkit.java:855)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
          at javax.swing.ImageIcon.<init>(ImageIcon.java:198)
          at javax.swing.ImageIcon.<init>(ImageIcon.java:217)
          at org.opends.guitools.controlpanel.util.Utilities.createImageIcon(Utilities.java:936)
          at org.opends.guitools.controlpanel.util.Utilities.createImageIcon(Utilities.java:947)
          at org.opends.guitools.controlpanel.util.Utilities.<clinit>(Utilities.java:146)
          at org.opends.guitools.controlpanel.datamodel.ControlPanelInfo.regenerateDescriptor(ControlPanelInfo.java:407)
          at org.opends.server.tools.status.StatusCli.execute(StatusCli.java:216)
          at org.opends.server.tools.status.StatusCli.mainCLI(StatusCli.java:169)
          at org.opends.server.tools.status.StatusCli.main(StatusCli.java:138)
      

      NOTE: workaround is to set the following java args `-Djava.awt.headless=true`

        Attachments

          Activity

            People

            • Assignee:
              austingene Gene Hirayama
              Reporter:
              csovant Christophe Sovant
              Dev Assignee:
              Gene Hirayama
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: