tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43669] New: - ApplicationDispatcher.unwrapRequest raises "cannot be cast to javax.servlet.ServletRequestWrapper"
Date Sun, 21 Oct 2007 20:36:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43669>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43669

           Summary: ApplicationDispatcher.unwrapRequest raises "cannot be
                    cast to javax.servlet.ServletRequestWrapper"
           Product: Tomcat 5
           Version: 5.5.24
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mailmur@yahoo.com


Tomcat 5.5.x:
http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/ApplicationDispatcher.java
  private void unwrapRequest(State state) {
    ...continue...
    // Advance to the next request in the chain
    previous = current;
    current = ((ServletRequestWrapper) current).getRequest(); // !! CAST ERROR
    ...continue...
  }

Exception is thrown when request is forwarded:
  "com.outerrim.servlet.OfflineHttpServletRequest cannot be cast to 
   javax.servlet.ServletRequestWrapper"

This is my offlineHttpServletRequest and Response classes:
  public class OfflineHttpServletRequest implements HttpServletRequest { ... }
  public class OfflineHttpServletResponse implements HttpServletResponse { ... }

They provide me a way to call servlet urls without the real webclient requests.
This is used in a background thread, that must trigger "dispatcher.forward(req,
res)" method call.
   RequestDispatcher dispatcher = ctx.getRequestDispatcher(url);
   dispatcher.forward(offReq, offRes);

Classes work fine in Tomcat5.0.x releases. 

Is it really a new requirement, that customized classes must inherit
ServletRequestWrapper/ServletResponseWrapper classes?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message