You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/01/09 01:28:37 UTC
DO NOT REPLY [Bug 5078] -
org.apache.catalina.connector.http.HttpRequestStream.close() method is too strict - it does not allow to close the stream twice
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5078>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5078
org.apache.catalina.connector.http.HttpRequestStream.close() method is too strict - it does not allow to close the stream twice
wdroste@momenta.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|Normal |Blocker
Status|RESOLVED |REOPENED
OS/Version|All |Windows NT/2K
Priority|Other |High
Platform|All |PC
Resolution|WONTFIX |
------- Additional Comments From wdroste@momenta.com 2002-01-08 16:28 -------
I'm trying to use chunked encoding to transfer xml data to a custom XML-Rpc
server. This on W2k w/ Tomcat 4.0.1 final and JAXP 1.1. Below is the
exception, it works without fail as long as I don't use chunked encoding. I'm
simply passing the inputstream into the JAX parser. I noticed that crimson and
catalina both do a close. I don't know which is correct but I know this works
as long as I don't do chunked encoding.
public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
// Check to see if there is a header for
// a particular encoding for the response.
String encoding = req.getHeader("ResponseEncoding");
if (encoding == null || encoding.equals(""))
res.setContentType("text/xml;charset=UTF-8");
else
res.setContentType("text/xml;charset="+encoding);
// Run Server Method the response will be written
srv.run(new InputSource(req.getInputStream()),encoding,res.getWriter());
}
Thanks,
Will
java.io.IOException: Cannot close the same input stream twice
at org.apache.catalina.connector.http.HttpRequestStream.close(HttpReques
tStream.java:158)
at java.io.PushbackInputStream.close(PushbackInputStream.java:306)
at org.apache.crimson.parser.XmlReader$BaseReader.close(XmlReader.java:5
95)
at org.apache.crimson.parser.XmlReader$Utf8Reader.read(XmlReader.java:64
7)
at org.apache.crimson.parser.XmlReader.read(XmlReader.java:487)
at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1006)
at org.apache.crimson.parser.InputEntity.peek(InputEntity.java:841)
at org.apache.crimson.parser.Parser2.peek(Parser2.java:2927)
at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:999)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:485)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at com.momenta.xmlrpc.UnMarshaller.parse(UnMarshaller.java:107)
at com.momenta.xmlrpc.Server$Worker.run(Server.java:85)
at com.momenta.xmlrpc.Server.run(Server.java:52)
at com.momenta.servlet.XMLRpcServer.doPost(XMLRpcServer.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:446)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.jav
a:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>