Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-3896

Error processing HEAD method by default HttpServlet#doHead()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.2
    • 2.0.3, 2.1.1, 2.2
    • specs
    • Security Level: public (Regular issues)
    • None
    • 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.

      Attachments

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

        Activity

          People

            djencks David Jencks
            ciand7 Andrey Utkin
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: