I apologize for the cross-posting. I already put this up on the main sun forums, but there’s a few slightly sharper graphics people here on the JGO forums. Any help would be appreciated.
Okay, so I’m creating a web-based game, and I’m doing just a wee bit of dynamic image creation. Up to this point everything has been working fine on tomcat 4.something, Java 1.4.2 running on Gentoo. I’m upgrading to Suse Professional 9.3, java 5 and Tomcat 5.0.30.
Everything seems to be working well, but my dynamic image generation keeps throwing one of the two following stack traces, seemingly at random:
java.lang.NoClassDefFoundError
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:164)
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
edited - myclass.performAction(edited - myclass.java:66)
edited - mysuperclass*.execute(edited - mysuperclass.java:86)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
OR
java.lang.InternalError: Can’t connect to X11 window server using ‘127.0.0.1:0’ as the value of the DISPLAY variable.
sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)
sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142)
java.security.AccessController.doPrivileged(Native Method)
sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:131)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:164)
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1141)
edited - myclass.performAction(edited - myclass.java:66)
edited - mysuperclass.execute(edited - mysuperclass.java:86)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Which error gets thrown depends on whether or not I’ve JUST bounced tomcat. At least . . . that’s the only factor I can figure out. (When I restart tomcat, I get the second stack trace, otherwise, the first.) It SEEMS as though I don’t have X installed, but it’s not only installed, it’s running. Here’s the output of ps -ef just to prove it:
root 6873 5967 0 03:53 ? 00:00:11 /usr/X11R6/bin/X -br -nolisten tcp :0 vt7 -auth /var/lib/xdm/authdir/authfiles/A:0-bI32tt
While I’m doing most of this configuration remotely on the command line via SSH, KDE is up and working, and was used for the initial install of all the software. Oh, and on that second stack trace, I’ve tried every value I can think of for the DISPLAY environment variable. localhost:0, :0 . . . nothing at all, I’m stumped on that count.
Frankly, I’m baffled. I’ve tried just running headless, but as I’m actually using BufferedImages, it seems that I cannot simply run a headless environment, or at least, I get exactly the same errors. Any suggestions?