Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException org.owasp.esapi.filters.SafeRequest cannot be cast to javax.servlet.ServletRequestWrapper using jdk1.6 #25

Closed
meg23 opened this issue Nov 13, 2014 · 4 comments

Comments

@meg23
Copy link

meg23 commented Nov 13, 2014

From ajitkaml...@gmail.com on May 14, 2009 11:11:05

We are getting the following error on chain.doFilter in the filter class
after we use the SafeRequest and SafeResponse with jdk1.6

ERROR [com.pgi.web.filter.SecureHttpFilter] java.lang.ClassCastException:
org.owasp.esapi.filters.SafeRequest cannot be cast to
javax.servlet.ServletRequestWrapper

The following line of code is used in the filter class:-

HttpServletRequest hrequest = (HttpServletRequest) request;
HttpServletResponse hresponse = (HttpServletResponse) response;
ESAPI.httpUtilities().setCurrentHTTP(hrequest, hresponse);

                        chain.doFilter(ESAPI.httpUtilities().getCurrentRequest(),

ESAPI.httpUtilities().getCurrentResponse());

Original issue: http://code.google.com/p/owasp-esapi-java/issues/detail?id=15

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From chrisisbeef on July 14, 2009 22:47:09

What Container/Application Server are you encountering this error under? (Please
include version)

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From ajitkaml...@gmail.com on August 05, 2009 12:24:17

we are using jboss application server and struts framework.here is the detail related
to this error

java.lang.ClassCastException: org.owasp.esapi.filters.SafeRequest cannot be cast to
javax.servlet.ServletRequestWrapper
at
org.apache.catalina.core.ApplicationDispatcher.unwrapRequest(ApplicationDispatcher.java:809)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:406)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From ajitkaml...@gmail.com on August 28, 2009 08:12:20

Any update on this?

I am getting this error on production also.

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From schal...@darkmist.net on December 13, 2009 19:11:13

Should be fixed in revision 911 . These two classes now extends
HttpServlet{Request,Response}Wrapper which should hopefully make containers more happy.

Be aware that these classes have been removed/renamed in 2.0.

Status: Fixed

@meg23 meg23 closed this as completed Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant