Use JFreeChart in a servlet (without display)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Stephane Levant

Use JFreeChart in a servlet (without display)

Post by Stephane Levant » Mon Dec 17, 2001 5:11 pm

I have a problem with JFreeChart in a servlet :
the servlet servor is running on a secure host without X servor.
I have the message "Can't connect to X11 window server"
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
...
at com.jrefinery.chart.JFreeChart.createVerticalBarChart
...

It is possible to use JFreeChart without X access ?

timp

RE: Use JFreeChart in a servlet (without display)

Post by timp » Mon Dec 17, 2001 11:00 pm

Yes,
you can use jfreechart without X, use the Pure Java AWT
(pja) see http://www.eteks.com/

cheers
timp

timp

RE: Use JFreeChart in a servlet (without display)

Post by timp » Mon Dec 17, 2001 11:00 pm

Yes,
you can use jfreechart without X, use the Pure Java AWT
(pja) see http://www.eteks.com/

cheers
timp

Matthew Parrish

RE: Use JFreeChart in a servlet (without display)

Post by Matthew Parrish » Tue Dec 18, 2001 1:01 am

Is there a performance hit to use the pja?

Thanks,
Matthew

Stephane Levant

RE: Use JFreeChart in a servlet (without display)

Post by Stephane Levant » Tue Dec 18, 2001 2:02 pm

Thanks, it's work fine.

It should be in the documentation (but perhaps it is already ?).

Chris Lukas

RE: Use JFreeChart in a servlet (without display)

Post by Chris Lukas » Thu Dec 20, 2001 10:37 pm

If you're concerned with licensing (and PJA is GPL not LGPL)
you can run Xvfb -- an X virtual frame buffer which exists for numerous platforms. Xvfb is essentially a monitor-less X server. You can do things like "xterm" and it starts up with the xterm displaying nowhere.

This works fine with the jfreechart lib for me.

- Chris

Lance Weber

RE: Use JFreeChart in a servlet (without display)

Post by Lance Weber » Thu Jan 24, 2002 12:45 am

This issue is also addressed in the Java2D FAQ. Basically, the new jdk1.4 handles this problem with a new 'headless' system property setting.

http://java.sun.com/products/java-media ... .html#xvfb

Locked