achiikun / tauon-ssh

Graphical SFTP client and terminal emulator (SSH) with helpful utilities
GNU General Public License v3.0
5 stars 2 forks source link

Error Running Tauon-SSH: Issues with Logging and HeadlessException #2

Closed JonathanCosta closed 1 month ago

JonathanCosta commented 1 month ago

Describe the bug
When attempting to run the application, it throws multiple warnings and errors related to unrecognized format specifiers in the log and a HeadlessException because no X11 DISPLAY variable is set.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the repository https://github.com/achiikun/tauon-ssh.
  2. Install dependencies and attempt to run the application.
  3. The error occurs immediately upon execution.

Expected behavior
The application should launch and display the main window without throwing errors.

Screenshots
N/A (No graphical interface appears due to the HeadlessException).

Desktop (please complete the following information):

Additional context
Here is the full error log:

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
Exception in thread "main" java.awt.HeadlessException: 
No X11 DISPLAY variable was set,
or no headful library support was found,
but this program performed an operation which requires it,
    at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:164)
    at java.desktop/java.awt.Window.<init>(Window.java:553)
    at java.desktop/java.awt.Frame.<init>(Frame.java:428)
    at java.desktop/javax.swing.JFrame.<init>(JFrame.java:224)
    at tauon.app.ui.containers.main.AppWindow.<init>(AppWindow.java:67)
    at tauon.app.App.main(App.java:102)

Java version:

openjdk version "21.0.4" 2024-07-16
OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu224.04)
OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu224.04, mixed mode, sharing)

It seems that the application requires a graphical environment (X11) but is being run in a headless environment. Additionally, the logging configuration might have some incorrect format specifiers.

JonathanCosta commented 1 month ago

I think it may be related to this comment. https://github.com/aws/aws-lambda-java-libs/issues/204#issuecomment-1577693473

JonathanCosta commented 1 month ago

I also found this https://rollbar.com/blog/java-headlessexception/ I'm trying to check where the problem is

JonathanCosta commented 1 month ago

I found the error. The error happened after my Ubuntu update. To solve it I had to run:

sudo apt install openjdk-21-jdk

As shown in the link below

https://improveandrepeat.com/2024/08/how-to-fix-the-no-x11-display-error-with-java-applications-on-ubuntu-24-04-lts/