Extreme X11-related weirdness

My nifty new Vaadin program is up and running on my webserver, but there is one little problem…

It seems to require that an Xserver be running on the webserver. Initially I installed it using terminal windows running on the Xserver (graphical display). It worked fine under these circumstances. But then I shut off the graphical display (killed the Xserver: /etc/init.d/gdm stop), and the Vaadin application stopped working. I got the X-related error messages listed below. I then restarted the Xserver, and stopped and restarted Tomcat. Then, it started working again.

Ordinarily, Tomcat would be started with a start-up script (in rc3.d). At the time that it would be started in this way, no Xserver would be running. The Vaadin application doesn’t run under these circumstances.

This all seems very odd but I’m sure there is a simple, logical explanation -? I’m using Ubuntu Linux with Tomcat 6.0.29.

TIA,

Matthew Fleming
Fleming Dermatopathology

ype Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:972)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:529)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause[font=Courier New]

[/font]

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:64)
com.flemingdp.db_access.Client_access_App.init(Client_access_App.java:29)
[/font]
com.vaadin.Application.start(Application.java:545)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1152)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:465)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleServiceException(AbstractApplicationServlet.java:972)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:529)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:169)
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
com.flemingdp.db_access.Client_access_App.init(Client_access_App.java:28)
com.vaadin.Application.start(Application.java:545)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1152)
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:465)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.

com.flemingdp.db_access.Client_access_App.init(Client_access_App.java:29)
[/font]

What are you doing on line 29 of your database access class ? You probably have some dependency on a Java routine that deals with fonts or images which is expecting to have a display around. Are you setting up traces or other console logging for your database ?

Oops. Thanks a lot for your response. I guess I’m just a little too used to applets…