ImageIO.write(image, "JPEG", responseOutputStream);

以前的一个项目中的一段程序,当运行的此之后就会报错,出现一下信息:

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0092884e, pid=720, tid=1016
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0-rc-b66 mixed mode)
# Problematic frame:
# j  sun.awt.image.IntegerComponentRaster.(Ljava/awt/image/SampleModel;Ljava/awt/image/DataBuffer;Ljava/awt/Rectangle;Ljava/awt/Point;Lsun/awt/image/IntegerComponentRaster;)V+8
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

后来看看错误日志,说是jpeg.dll出现问题,我就在想啊,这怎么会出现这个问题呢,原来我以前就有一个jdk1.5,后来又装了个jdk1.6,而我的项目还是用的jdk1.5的jar,但tomcat却是1.6的jdk运行环境,晕死。把项目的jdk1.5改成1.6版本就OK了

你可能感兴趣的:(ImageIO.write(image, "JPEG", responseOutputStream);)