Page 1 of 1

Could not initialize class sun.awt.X11GraphicsEnvironment

PostPosted: Tue Apr 20, 2010 8:40 pm
by Pathduck
When starting Subsonic I get a lot of constant exceptions in the log like this:

[2010-04-20 22:29:25,321] WARN CoverArtController - Failed to create thumbnail for /mnt/dlink-mp3/.Elektronic/Neon Neon - Stainless Style[2008]/folder.jpg
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)


Also there very few thumbs being generated in Subsonic.

I think I did a recent java update so could it be caused by this? Running Debian squeeze/sid:
Linux debian 2.6.32-3-amd64 #1 SMP Wed Feb 24 18:07:42 UTC 2010 x86_64 GNU/Linux

java version "1.6.0_0"
OpenJDK Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)

To fix it I had to edit subsonic.sh and add: -Djava.awt.headless=true in the Java call. The server is obviously headless, but I never had to explicitly set it before to make the thumbnails generate. This should be unnecessary right?

Any ideas? I mean, I've fixed it for myself but it will break with the next update again if I have to manually edit the sh script :(

-P

worked for me

PostPosted: Thu Jun 24, 2010 11:43 pm
by mr_stupid
I had the same problem. Did what Pathduck recommended and all is well.

In file /usr/share/subsonic/subsonic.sh "add: -Djava.awt.headless=true in the Java call". Looks something like this:

--------------------
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
-Dsubsonic.home=${SUBSONIC_HOME} \
-Dsubsonic.host=${SUBSONIC_HOST} \
-Dsubsonic.port=${SUBSONIC_PORT} \
-Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
-Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
-Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
-Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
-Djava.awt.headless=true \
-jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &
----------------------------------------

Tks Pathduck :D, and
Tks Sindre. :D