8 Replies Latest reply on Oct 2, 2009 6:25 AM by johnbat26

    he body of the request is lost when you send POST

    johnbat26

      Hello!
      I have a critical issue, most likely associated with JBossWeb-2.0.1.GA (Tomcat 5.5.X).
      ------------------------------
      My environment:
      OS: RHEL 5 x86 or x86-64;
      JVM: sun-jdk-1.6.0.16 or jrockit-R27.5.0-jdk1.6.0_03;
      AS: JBoss AS 4.2.2.GA (with Tomcat 5.5.X (JBossWeb-2.0.1.GA ) inside)

      ------------------------------
      I implemented web-service using apache xml-rpc 3.1.2.
      Then I call it from the http client. (apache httpclient 4.0).
      This my request:
      Code:

      POST /cas-services-verimatrix-pull/pull HTTP/1.1
      Host: 10.20.2.150:8080
      Accept: */*
      Content-Type: text/xml
      Content-Length: 391
      
      <?xml version="1.0" encoding="UTF-8"?>
      <methodCall>
      <methodName>EISTMPull.getEntitlement</methodName>
      <params>
      <param><value><string>00020215B9FE</string></value></param>
      <param><value><base64>
      
      </base64></value></param>
      <param><value><array><data>
      <value><string>DTV</string></value>
      <value><string>PPV</string></value>
      </data></array></value></param>
      </params>
      </methodCall>
      
      



      This request is almost always handled properly.But sometimes the body of the HTTP request is lost and the server sends a reply, as if the request body is empty:
      Code:

      HTTP/1.1 200 OK
      Server: Apache-Coyote/1.1
      X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA
      date=200710221139)/Tomcat-5.5
      Content-Type: text/xml
      Content-Length: 312
      Date: Fri, 07 Aug 2009 15:16:19 GMT
      
      <?xml version="1.0"?>
      <methodResponse>
      <fault>
      <value>
      <struct>
      <member>
      <name>faultString</name>
      <value>java.lang.NoSuchMethodException: ru.cti.oss.cas.verimatrix.pull.Pull.getEntitlement()</value>
      </member>
      <member>
      <name>faultCode</name>
      <value><int>0</int></value>
      </member></struct></value>
      </fault>
      </methodResponse>
      




      First used xml-rpc version 2, then I updated it to 3.1.2. Accordingly, the
      error must be at the level of tomcat.

      I fulfilled a lot of tests. This error does not depend on the load application
      server. Fortuitous . But because of this, our clients can not work normally.
      Therefore, I think this problem critical.

      Please, help with what could be wrong?
      https://issues.apache.org/bugzilla/show_bug.cgi?id=47797

      Thanks in advance

        • 1. Re: he body of the request is lost when you send POST
          jaikiran

          Post the client code which sends this request.

          • 2. Re: he body of the request is lost when you send POST
            jfclere

            "AS: JBoss AS 4.2.2.GA (with Tomcat 5.5.X (JBossWeb-2.0.1.GA ) inside)"

            No JBossWeb-2.0.1.GA is based on Tomcat 6.0.x.

            jaikiran See https://issues.apache.org/bugzilla/attachment.cgi?id=24267 I think that the client code is there.

            • 3. Re: he body of the request is lost when you send POST
              erasmomarciano

              How can I check the versione tomcat into my Jboss

              • 5. Re: he body of the request is lost when you send POST
                jaikiran

                 

                "jfrederic.clere@jboss.com" wrote:
                "AS: JBoss AS 4.2.2.GA (with Tomcat 5.5.X (JBossWeb-2.0.1.GA ) inside)"

                No JBossWeb-2.0.1.GA is based on Tomcat 6.0.x.



                Yeah, that's one of the things that we told JohnBat over #jboss IRC where he asked pinged for inputs. But the X-Powered-By header output seems to be adding to the confusion :) :

                X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA
                date=200710221139)/Tomcat-5.5
                




                • 6. Re: he body of the request is lost when you send POST
                  johnbat26

                  see last post in bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=47797

                  How I may upgrade jBossWEb up to 2.1.4 in Jboss 4.2.2 ?

                  • 7. Re: he body of the request is lost when you send POST
                    johnbat26

                    I embed several count of code in Http11Processor and StandardEngineValve.
                    In Http11Processor,process() I added next after invoke
                    inputBuffer.parseRequestLine(); :

                    if (request.unparsedURI().equals("/lost-post/generic"))
                     {
                    log.error("----------------------------------------------------------");
                     StringBuffer stringBuffer = new StringBuffer();
                     for (int i = 0; i < inputBuffer.buf.length; i++) {
                     stringBuffer.append((char) inputBuffer.buf);
                     }
                    
                     log.error(stringBuffer);
                     log.error("LENGTH: "+ inputBuffer.buf.length);
                    
                     log.error("++++++++++++++++++++++++++++++++++++++++++++++");
                     }



                    and in StandardEngineValve.invoke() I added next code:

                    if (request.getWrapper().getName().equals("LostPostGenericServlet"))
                     {
                    
                    log.error("-----------------------------------------------------------------------------");
                     StringBuffer stringBuffer = new StringBuffer();
                     InputStream input = request.getInputStream();
                     int i=request.getContentLength();
                     int c;
                     while (((c = input. read()) != -1) && (--i > 0)) {
                     stringBuffer.append((char) c);
                     }
                     input.close();
                    
                     log.error(stringBuffer);
                     PrintWriter out = response.getWriter();
                     if (stringBuffer.length() > 0) {
                     StringBuffer xmlBuffer = new StringBuffer();
                     xmlBuffer.append("<?xml version='1.0' encoding='UTF-8'?>");
                     xmlBuffer.append("<methodCall>");
                     xmlBuffer.append("OK");
                     xmlBuffer.append("</methodCall>");
                     out.print(xmlBuffer);
                     System.out.println("OK");
                     } else {
                     StringBuffer xmlBuffer2 = new StringBuffer();
                     xmlBuffer2.append("<?xml version='1.0' encoding='UTF-8'?>");
                     xmlBuffer2.append("<methodCall>");
                     xmlBuffer2.append("FAILED");
                     xmlBuffer2.append("</methodCall>");
                     out.print(xmlBuffer2);
                     System.out.println("FAILED");
                     }
                     out.close();
                     log.error("++++++++++++++++++++++++++++++++++++++++++++++");
                     return;
                     }


                    -----------------------
                    So added code in Http11Processor print entire buffer, whereas code in
                    StandardEngineValve print content of body from CoyoteInputStream.
                    When I increase loading at tomcat (with help of Grinder) happen this error,
                    and code in Http11Processor print normal request with body, whereas code in
                    StandardEngineValve print empty string:
                    ...
                    2009-10-01 20:11:30,588 ERROR [Http11Processor]
                    -----------------------------------------------------------------------------
                    2009-10-01 20:11:30,589 ERROR [Http11Processor] POST /lost-post/generic
                    HTTP/1.1
                    Accept-Encoding: gzip,deflate
                    Content-Type: text/xml;charset=UTF-8
                    SOAPAction: ""
                    User-Agent: Jakarta Commons-HttpClient/3.1
                    Host: 172.20.0.3:8080
                    Content-Length: 389
                    
                    <?xml version="1.0" encoding="UTF-8"?>
                    
                    <methodCall>
                    
                    <methodName>EISTMPull.getEntitlement</methodName>
                    
                    <params>
                    
                    <param><value><string>00020215B9FE</string></value></param>
                    
                    <param><value><base64>
                    
                    </base64></value></param>
                    
                    <param><value><array><data>
                    
                    <value><string>DTV</string></value>
                    
                    <value><string>PPV</string></value>
                    
                    </data></array></value></param>
                    
                    </params>
                    
                    </methodCall>e2:$Version="1""
                    
                    ntent-type:application/x-www-form-urlencoded; charset=UTF-88
                    content-length:633
                    
                    j_username=00%3A02%3A02%3A14%3A47%3A2e&j_password=702007D314410
                    2009-10-01 20:11:30,589 ERROR [Http11Processor] LENGTH: 8192
                    2009-10-01 20:11:30,589 ERROR [Http11Processor]
                    ++++++++++++++++++++++++++++++++++++++++++++++
                    2009-10-01 20:11:30,589 ERROR [StandardEngineValve]
                    -----------------------------------------------------------------------------
                    2009-10-01 20:11:30,589 ERROR [StandardEngineValve]
                    2009-10-01 20:11:30,590 ERROR [StandardEngineValve]
                    ++++++++++++++++++++++++++++++++++++++++++++++



                    Therefore error happen inside tomcat ! During parsing body
                    of request. Often this happen during increase loading at other applications
                    deployed in tomcat.

                    I conclude several tomcat classes, which uses in JBossWeb, because don't know,
                    which version of tomcat used in JBossWeb 2.0.3.GA

                    Many thanks in advance for any some help.

                    • 8. Re: he body of the request is lost when you send POST
                      johnbat26

                      I changed connector to Http11NioConnector:

                      <Connector port="8080" address="${jboss.bind.address}"
                       protocol="org.apache.coyote.http11.Http11NioProtocol"
                       redirectPort="8443"/>


                      this problem persist :(