tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: AW: AW: java.io.IOException: Stream closed
Date Fri, 05 Dec 2008 16:42:59 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan,

Schuster Stefan wrote:
> The code reading the stream is generated by XMLBeans. 
> 
> Is there something that I should not do with the stream? For example
> closing it or something like that?

You shouldn't have to do anything like that.

> <<<ERROR>>>
> 			inDoc = DataDocument.Factory.parse(is, xmlOptions);
> <<<END_OF_ERROR>>>

Looks reasonable to me. Does DataDocument.Factory.parse() do anything
weird like close the stream and then try to read from it again?

Your problem is probably caused by one of two things:

1. Some code stupidly closes the input stream, then tries reading
   from it later

2. The client didn't send enough data

I wonder if there's a character encoding problem, here. You are using an
InputStream from the request and not a Reader, so the Content-Type
encoding from the request is being ignored. If the XML processing
instruction includes an "encoding" parameter, this might be okay, but
I've seen XML documents saying one type of encoding while the actual
encoding is something else (whoops!).

What client are you using to submit this data to the servlet?

Also, what Connector are you using in Tomcat? AJP? HTTP? Nio?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk5WhMACgkQ9CaO5/Lv0PCfSwCfef6s6a3meZROUFiJsGBEgSgx
zbgAn1bOUSVVikoGJLNy3Dvgot0bHCoR
=rJcd
-----END PGP SIGNATURE-----

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


Mime
View raw message