Please be aware that there is newer version of documentation available for Webswing. Documentation 24.2
Can't connect to X11 using ':99'
Expected Behavior
Application starts normally
Actual Behavior
When trying to launch session, session is automatically getting terminated.
Exception
2019-03-13 03:17:55,383 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':99' as the value of the DISPLAY variable.
2019-03-13 03:17:55,383 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
2019-03-13 03:17:55,383 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
2019-03-13 03:17:55,383 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at java.security.AccessController.doPrivileged(Native Method)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2019-03-13 03:17:55,384 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at java.lang.reflect.Method.invoke(Method.java:498)
2019-03-13 03:17:55,385 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at org.webswing.toolkit.WebToolkit.init(WebToolkit.java:131)
2019-03-13 03:17:55,385 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at main.Main.initializeExtLibServices(Main.java:139)
2019-03-13 03:17:55,385 ERROR [Webswing Process Handler] (SwingProcessImpl.java:281) [demo_anonym_829470cca8e3_1552461474257] at main.Main.main(Main.java:44)
2019-03-13 03:17:55,385 INFO [Webswing Process Handler] (SwingProcessImpl.java:123) [demo_anonym_829470cca8e3_1552461474257] app process terminated.
Steps to Reproduce the Problem
- Install Webswing on Linux
- Start Webswing
- Start any demo application through browser
Specifications
- Version: 2.6.2
- Platform: Linux
- Java version and distribution: Amazon Corretto 8
Solution
this means you do not have a Xvfb session running. Swing requires Xvfb on headless linux to start. Please see: documentation/starting-on-linux