No X11 DISPLAY was set ERROR!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mrburns2002
Posts: 6
Joined: Tue Feb 10, 2009 12:50 pm

No X11 DISPLAY was set ERROR!

Post by mrburns2002 » Fri Apr 03, 2009 12:26 pm

Hi,

I was running some JFree methods on a server an following error occurred:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Code: Select all

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
    at java.awt.Window.<init>(Window.java:406)
    at java.awt.Frame.<init>(Frame.java:402)
    at javax.swing.JFrame.<init>(JFrame.java:207)
    at org.jfree.ui.ApplicationFrame.<init>(ApplicationFrame.java:65)
    at de.tudarmstadt.ukp.dkpro.community_mining.reader.TimeSeriesChart.<init>(TimeSeriesChart.java:82)
    at de.tudarmstadt.ukp.dkpro.community_mining.reader.TrendReader.createTagCoocChart(TrendReader.java:835)
    at de.tudarmstadt.ukp.dkpro.community_mining.reader.TrendReader.getNext(TrendReader.java:360)
    at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.readNext(ArtifactProducer.java:494)
    at org.apache.uima.collection.impl.cpm.engine.ArtifactProducer.run(ArtifactProducer.java:711)
Do you have an idea how to disable the X11 set? As the server does not support X11, I would like to deactivate the GUI - I just want the program to generate my PNG files silently!

Is that possible?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: No X11 DISPLAY was set ERROR!

Post by skunk » Fri Apr 03, 2009 12:53 pm

http://www.jfree.org/jfreechart/faq.html
#10

From the stack trace it appears as though your code is trying to create a JFrame, which will obviously fail on a server.

mrburns2002
Posts: 6
Joined: Tue Feb 10, 2009 12:50 pm

Re: No X11 DISPLAY was set ERROR!

Post by mrburns2002 » Mon Apr 06, 2009 5:00 pm

skunk wrote:http://www.jfree.org/jfreechart/faq.html
#10

From the stack trace it appears as though your code is trying to create a JFrame, which will obviously fail on a server.
This problem still occurs. Even after having taken your ideas into account.
Is it possible to redirect the output to my local server? I am using ssh.

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Re: No X11 DISPLAY was set ERROR!

Post by Taqua » Fri Apr 10, 2009 3:01 pm

So why dont you simply enable X11-Fowarding then? See your faviourite sshd.conf man-page for details on that.

But be aware that the use of ApplicationFrame classes outside of demo code is rarely correct (unless correctness includes the hard killing of your application via "System.exit(0)" - as this is what happens if you close the frame). JFreeChart is happily usable without any frames. Creating frames will cause Headless-Exceptions (if you enable headless mode), so in case you write a server application (or anything that does not require a UI) you will shot yourself in the foot whenever you use Frames, Windows or anything in that direction.
Read my Blog for the latest Pentaho Report Designer Tips and Tricks.

Locked