I've Googled around, but I'm trying to figure out the right way to fix this. We have Java code that uses java.awt (Graphics2D stuff) to generate an image (which I've just read online could use some system-dependent stuff), and we've ported the code over to Linux, but now we're getting this error when our web app tries to generate the image:
Code:
javax.servlet.ServletException: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
What's the best way to fix this? We're running just about the latest release, I think: Red Hat Enterprise Linux 3. Is there a quick and easy way to install something, or something even simpler, or what?
I Googled around some more, and then I went onto the app server as root and did the following:
#export DISPLAY=localhost:0.0
#xhost +
access control disabled, clients can connect from any host
I'm not sure if that fixed the problem. Now the error changed to the stuff down below, but I don't think it fixed it, because in my app logs I'm seeing NullPointerExceptions when trying to do stuff with the image:
Code:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp.CreateShipment_jsp._jspService(CreateShipment_jsp.java:1197)