X11 DISPLAY troubles

Hi,

We've been developing a Web Application in Windows, using the Sun Java System Application Server Platform 9 installed on the same PC. Just now, we want to move the web application into a Red Hat Linux Server, also with the Sun Application Server, and run the application with a host PC wih Windows. The application starts OK, but launches an exception (cited below) when it has to open a 'File Dialog Box'. The exception is:

Servlet.service() for servlet Faces Servlet threw exception

java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Note that we doesn't have this problem running the application in local using Windows.

Actually, the Red Hat Linux has no graphical environment.

How to solve this problem? It's compulsory to have a graphical environment in the server?

Thanks a lot!!

Xavi.

[940 byte] By [xaviCATa] at [2007-11-27 5:06:03]
# 1

> How to solve this problem? It's compulsory to have a

> graphical environment in the server?

In order to open a file dialog box? Well, yes. However, under X11 you can redirect the UI to another machine running an xserver -- or use a dummy xserver.

http://en.wikipedia.org/wiki/Xvfb

quittea at 2007-7-12 10:24:40 > top of Java-index,Java Essentials,Java Programming...
# 2

Your app apparently has a GUI, but you're running the program without a GUI. Do you see the conflict there?

Linux (usually) uses X11 as its GUI toolkit. The error message you're seeing is saying that it's trying to use X11, but the way you're running the program, X11 hasn't been properly set up.

A good way to deal with this is:

1) install Cygwin, including the X11 utilities.

2) start the X11 server on your PC. The command for this is "startxwin.bat", in Cygwin, I believe.

3) connect to your linux box. Either:

3.1) use the xhost utility to configure your PC's X server to accept

connections from your linux box, and then set the DISPLAY variable

on your linux box

or

3.2) use X11 tunnelling (e.g., if you're using putty) when connecting to

your linux box

4) then you can run the program

paulcwa at 2007-7-12 10:24:40 > top of Java-index,Java Essentials,Java Programming...