1 Reply Latest reply on May 1, 2008 2:35 AM by shane.bryzak

    Http POST input is unparseable



      I am trying to use Seam in a non-JSF Web Application with version 2.0.0.GA.

      I have a servlet in the app which receives XML messages and processes them.

      My components.xml has

      <web:context-filter url-pattern="/m/*" />

      and I can see the Seam components being instantiated and invoked OK.

      However, I get the following message in my logs

      2008-04-30 10:59:33,086 DEBUG http- [AbstractMessagingServlet] Extracting XML Document from HTTP Servlet Request...
      2008-04-30 10:59:33,101 ERROR http- [LoggerStream] [Fatal Error] :-1:-1: Premature end of file.
      2008-04-30 10:59:33,101 DEBUG http- [AbstractMessagingServlet] SAXException (Premature end of file.). Will try to dump raw request data...
      2008-04-30 10:59:33,101 DEBUG http- [AbstractMessagingServlet] Content-type: application/x-www-form-urlencoded
      2008-04-30 10:59:33,101 DEBUG http- [AbstractMessagingServlet] Content-Length: 575
      2008-04-30 10:59:33,101 DEBUG http- [AbstractMessagingServlet] Error trying to dump raw request data (sorry)
      java.io.IOException: mark/reset not supported

      when I try and take the HttpServletRequest.getInputStream() and parse the contents into an XML Document using the following code:

       DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = factory.newDocumentBuilder();
              Document xmlDocument = builder.parse(request.getInputStream());
              if (LOG.isDebugEnabled()) {
                  LOG.debug("Dumping extracted XML Document...");
              return xmlDocument;

      However, when I remove the Seam Filter from the XML message servlet

          <filter-name>Seam Filter</filter-name>

      I can parse the message without any problems.

      Have you any idea why the stream is getting munged?



        • 1. Re: Http POST input is unparseable

          The only filter that should manipulate the request is MultipartFilter, and only if the request is a multipart request (i.e. a file upload).  If you could put together a reproducible test case and create a JIRA issue for it then I'd be happy to take a look.