Servlet cannot use Toolkit.Image.getGraphics()

V

vizlab

Hi:
On windows XP, I have a servlet in which ToolkitImage calls
getGraphics().
The error below always occurs:

java.lang.UnsupportedOperationException: getGraphics() not valid for
images created with createImage(producer)
sun.awt.image.ToolkitImage.getGraphics(Unknown Source)

Basically, I use BufferedImage to generate a image and then save it.
But when I generate the image, for some reason,
ToolkitImage.getGraphics() is used. This triggered exceptions.

I have already set -Djava.awt.headless=true.

When I run the servlet on linux, it works fine.
When I run the servlet in eclipse on Window XP, the error occurs.
Can anybody tell the reason?
Thanks a lot for your help.

Best

Lian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top