Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
JonathanCosta opened this issue Sep 29, 2024 · 3 comments
Closed

Comments

@JonathanCosta
Copy link

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):

  • OS: Ubuntu 22.04 LTS
  • Java version: 21.0.4

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
Copy link
Author

I think it may be related to this comment.
aws/aws-lambda-java-libs#204 (comment)

@JonathanCosta
Copy link
Author

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

@JonathanCosta
Copy link
Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant