Hi all
We are using WebSphere 3.5.4
We are truying generate a image dynamically in a servlet.
Here is the sample peice of the code generating the image :-
BufferedImage buffImg = new BufferedImage(400, 400,
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = buffImg.createGraphics();
graphics2D.setBackground(Color.blue);
// graphics2D.setColor(new Color(250));
Line2D.Double horiz = new Line2D.Double(0, 200, 0, 200);
Rectangle2D.Double rect = new Rectangle2D.Double(200, 20, 50, 50);
graphics2D.setBackground(Color.pink);
graphics2D.setColor(Color.white);
graphics2D.drawRect(40, 0, 20, 150);
graphics2D.drawRect(80, 0, 20, 200);
graphics2D.drawRect(120, 0, 20, 210);
graphics2D.drawRect(160, 0, 20, 380);
graphics2D.drawRect(200, 0, 20, 150);
java.io.FileOutputStream fstr = new java.io.FileOutputStream("somefile");
com.sun.image.codec.jpeg.JPEGImageEncoder enc = new
sun.awt.image.codec.JPEGImageEncoderImpl(fstr);
enc.encode(buffImg);
fstr.close();
The problem is this piece of code works fine when it runs as a
application or as a servlet on windows.
But when we run it on WebSphere on solaris, we are getting the following
exception :-
Exception occured java.lang.InternalError: Can't connect to X11 window
server
using ':0.0' as the value of the DISPLAY variable.
We did set the DISPLAY variable to XServer. Still we are getting this
error.
Our suspiscion is that we are not setting it at the correct place?
Does any one have solution to this problem or know how to set DISPLAY
variable for was3.5.4?
Rajs
**************************Disclaimer************************************
Information contained in this E-MAIL being proprietary to Wipro Limited is
'privileged' and 'confidential' and intended for use only by the individual
or entity to which it is addressed. You are notified that any use, copying
or dissemination of the information contained in the E-MAIL in any manner
whatsoever is strictly prohibited.
***************************************************************************