Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#408 closed defect (fixed)

jrobin graphs do not appear on a headless server

Reported by: Mathiasdm Owned by: Mathiasdm
Priority: trivial Milestone: 0.8.4
Component: apps/console Version: 0.8.3
Keywords: Cc:
Parent Tickets: Sensitive: no


Due to the addition of desktopgui, which requires headless to be off in the JVM, jrobin graphs do not appear on a headless server.


Change History (6)

comment:1 Changed 10 years ago by Mathiasdm

Status: newaccepted

comment:2 Changed 10 years ago by Mathiasdm

Root cause: during boot, the 'headless' setting in the JVM is set to true, instead of a check being performed to make sure we're in a headless environment.

Desktopgui initially worked around this by setting headless to false, but this broke in headless environments. Setting headless to true after initializing desktopgui was also not a solution. This is because GraphicsEnvironment? is (I think) a singleton. As such, desktopgui causes a non-headless GraphicsEnvironment? to be loaded. When jrobin tries to load an environment, it will get the same singleton and crash.

The actual fix (currently under test) is to determine if we are in headless or non-headless mode.
This can be done by setting headless to false and requesting a GraphicsEnvironment?. If this fails, we can set a 'headless' property in I2P to true (and in the other case, to false). Then, we need to reboot (to get rid of the singleton GraphicsEnvironment?).
Based on the property, we can then set the 'headless' property correctly.

comment:3 Changed 10 years ago by zzz

Component: unspecifiedapps/console
Priority: majorblocker

comment:4 Changed 10 years ago by Mathiasdm

Resolution: fixed
Status: acceptedclosed

Fixed in -10, as explained in my previous comment.

comment:5 Changed 10 years ago by Mathiasdm

Fixed cleanly (without requiring I2P restart) in -11.

comment:6 Changed 8 years ago by DISABLED

Priority: blockertrivial

Im adding the following for future reference as this might be a faq topic for others:

If you arent getting graphs on a headless installation of i2p it is because you are missing some needed libraries for x11 interfaces to java. To solve this you will need to find out what is missing.
ldd $JAVA_HOME/jre/lib/$ARCH/xawt/

ldd /usr/lib/jvm/java-7-openjdk/jre/lib/amd64/xawt/ | grep 'not found'

depending on how useful your distros package manager is, you should be able to find what package provides what library.

In my case i was missing and which was provided by my distros 'gtk' package. And presto graphs working!
Hope this helps.

Note: See TracTickets for help on using tickets.