Geronimo
  1. Geronimo
  2. GERONIMO-3896

Error processing HEAD method by default HttpServlet#doHead()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.3, 2.1.1, 2.2
    • Component/s: specs
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      Geronimo 2.0.2/Tomcat, Geronimo 2.1?

      Description

      I have Servlet with use RequestDispatcher.include()/forward() to JSP.
      My Servlet extends HttpServlet. I don`t overwrite doHead() method.
      While processing HEAD method following exception throws:

      09:18:57,647 ERROR [[SimpleDispatchServlet]] Servlet.service() for servlet SimpleDispatchServlet threw exception
      javax.servlet.ServletException: Original SevletResponse or wrapped original ServletResponse not passed to 
      RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1
              at org.apache.catalina.core.ApplicationDispatcher.checkSameObjects(ApplicationDispatcher.java:985)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:493)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
              at com.km.webapp.test.simple.SimpleDispatchServlet.doGet(SimpleDispatchServlet.java:26)
              at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:274)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
              at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
              at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)
      

      Exploring code I found that Tomcat`s implementation of RequestDispatcher expects that passed Response/Request objects is original objects or is wrapped by ServletRequestWrapper/ServletResponseWrapper. But geronimo-servlet_2.5_spec/HttpServlet.java#doHead() use NoBodyResponse class which is not instance of ServletResponseWrapper. So, exception thrown.

      1. GERONIMO-3896.patch
        4 kB
        David Jencks
      2. geronimo-servlet_2.5_spec-1.1.1-fake.jar
        69 kB
        David Jencks

        Activity

        Hide
        David Jencks added a comment -

        After spec jar release, update server builds to use it.
        branches/2.0 rev 637748
        branches/2.1 rev 637749
        trunk rev 637750

        Show
        David Jencks added a comment - After spec jar release, update server builds to use it. branches/2.0 rev 637748 branches/2.1 rev 637749 trunk rev 637750
        Hide
        David Jencks added a comment -

        Patch committed in rev 636511. Spec release vote pending, then we can get it into the actual geronimo servers.

        Show
        David Jencks added a comment - Patch committed in rev 636511. Spec release vote pending, then we can get it into the actual geronimo servers.
        Hide
        David Jencks added a comment -

        will try to get servlet spec release out shortly.
        Tomcat has agreed this is a bug and applied the fix in the patch.

        Show
        David Jencks added a comment - will try to get servlet spec release out shortly. Tomcat has agreed this is a bug and applied the fix in the patch.
        Hide
        Andrey Utkin added a comment -

        Forget to note, I have only check Geronimo 2.0.2.

        Show
        Andrey Utkin added a comment - Forget to note, I have only check Geronimo 2.0.2.
        Hide
        Andrey Utkin added a comment -

        Problem is fixed by jar you provide. Thanks.

        Show
        Andrey Utkin added a comment - Problem is fixed by jar you provide. Thanks.
        Hide
        David Jencks added a comment -

        Here's a compiled version of the spec jar with the patch applied. You can try copying it over the original and see if the problem is fixed.

        Show
        David Jencks added a comment - Here's a compiled version of the spec jar with the patch applied. You can try copying it over the original and see if the problem is fixed.
        Hide
        David Jencks added a comment -

        This certainly looks like a spec violation to me. Does the attached patch look like it would fix the issue?

        Show
        David Jencks added a comment - This certainly looks like a spec violation to me. Does the attached patch look like it would fix the issue?

          People

          • Assignee:
            David Jencks
            Reporter:
            Andrey Utkin
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development