hi, i create a buffered im age with the help of a servlet and show it on a jsp.
i have installed jdk 1.4.2 and tomcat 4.1 under windows...
if i run the web-application with the tomcat serven on my system everything is fine.
if i run it ou an external server tomcat 4.1 with jre 1.4.2_02 und er linux the following error occurs when the image should appear:
java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62) at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1041) at gelcali.DrawGel.doGet(DrawGel.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
why??? is it not possible to run the server under linux with jre and show buffered images?
thanks matthias
p.s.: i create the buffered image by the following way:
Many of the operations in the java.awt package rely on native support - ie they tie into the underlying operating system. I've run into this problem before where the linux installation doesn't have any graphics support (ie 'headless'), typically with the error "Can't connect to X11 window server"
But there is a work around - here is an api called PJA (Pure Java AWT) which implements the required graphics support with a purely Java implementation. I still had some problems that I didn't end up fixing - like using Fonts - but all I was doing was simple graphics conversion, and this worked fine.