I'm using Java2D in a UNIX servlet environment where there
is no guarantee of an Xserver running, and the best solution I've found
is to run the Xvfb "virtual frame buffer" Xserver from x.org's X11R6.4
distribution. I had to download the source (+ patches) and compile it for
Solaris. You can run Xvfb as a daemon something like this (or wrap it in
a UNIX initialisation/termination script):

# /usr/X11R6/bin/Xvfb :1 -screen 0 1152x900x8 2>> /var/adm/Xvfb.log &

You will have to set DISPLAY=`hostname`:1.0 for your Java process.
GUI-less Java AWT/2D code should run pretty happily. Not an ideal
solution but it works and avoids having someone logged in on the
console forever.

Warning: Java 2 (and possibly earlier versions) complains about missing fonts
when using X11R6/Xvfb. On Solaris this has been known to occasionally cause
the JVM to dump core.

I fixed this by adding the two missing Type1 .pfb fonts to
/usr/X11R6/lib/X11/fonts/Type1, Symbol and ZapfDingbats,
and adding the 2 following lines to fonts.dir and fonts.scale:

Symbol.pfb --symbol-medium-r-normal--0-0-0-0-p-0-sun-fontspecific
Zapfdingbats.pfb -urw-itc
zapfdingbats-medium-r-normal--0-0-0-0-p-0-sun-fontspecific

Remember to bump the line count at the top of these files.

[ If anyone from Sun is reading this, please add Xvfb to X11 in the next
release of Solaris.]

Kurt Williams wrote:

> So does this mean that you have to have the X client running on the Web
> server?  This also implies that there must be graphics hardware present
> on the Web server as well.  Most ISP's who have rack-mounted banks of
> servers will probably not even have graphics hardware installed on their
> servers.  I suppose that means that I'm out of luck for those types of
> configurations.  Does anybody know of a way around this?

--Richard.
_______________________________________________________________
Richard Weatherley                    [EMAIL PROTECTED]
Social Change Online                    Tel: +61 (0)2 9557 6500
6A Nelson Street                        Fax: +61 (0)2 9519 8940
Annandale NSW 2038 Australia    http://online.socialchange.net/

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to