tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eurotrans-Verlag" <verlag.preis...@t-online.de>
Subject RE: AJP-APR failures on Tomcat 7.0.16 with ISAPI Redirector 1.2.32
Date Wed, 13 Jul 2011 22:53:59 GMT
Hi Rainer,

> -----Original Message-----
> From: Rainer Jung [mailto:rainer.jung@kippdata.de]
> Sent: Thursday, July 14, 2011 12:17 AM
> At least there was trouble about Java2D for several users in the past.
> One such issue:
> 
> https://issues.apache.org/bugzilla/show_bug.cgi?id=41772
> http://nerd.dk/blogs/bug-tomcat-or-java2d
> 
> but you might find more.
> 
> Regards,
> 
> Rainer
> 

Thanks. In the meantime, I also came to that conclusion and replaced all
instances of

ImageIO.write(img, "PNG", response.getOutputStream())

in my servlets/webapps with something like

ByteArrayOutputStream bout = new ByteArrayOutputStream();
ImageIO.write(img, "PNG", bout);
bout.writeTo(response.getOutputStream());

so that the ImageIO never sees the real OutputStream, and it seems to work
fine (no more IllegalStateExceptions or "wrong message format" errors in the
isapi log when using AJP-APR).

Is that a good practice (using ByteArrayOutputStream, then copy it to the
response) to dynamically generate Images and serve them to the clients?
Also, is there any hint to this on the Tomcat documentation/wiki? Because I
don't think it would be unusual to dynamically generate images and serve
them to clients using the ImageIO, and I think it could be a bit frustrating
to find the actual problem if one doesn't know this.


Thanks!


Regards,
Konstantin Prei├čer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message