[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[jetty-users] RequestLogHandler in 8.1.12 fails to handle forwarded requests in grails
|
Hi, all
After jetty upgrade from 8.1.11 to 8.1.12 we got error with stacktrace:
java.lang.ClassCastException: org.codehaus.groovy.grails.web.sitemesh.GrailsContentBufferingResponse cannot be cast to org.eclipse.jetty.server.Response
at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:90)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:276)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103)
at org.codehaus.groovy.grails.web.util.WebUtils.forwardRequestForUrlMappingInfo(WebUtils.java:314)
Compare RequestLogHandler code in 8.1.11 version:
public void handle(String target, final Request baseRequest, HttpServletRequest request, final HttpServletResponse response)
throws IOException, ServletException
{
...
if (_requestLog != null && DispatcherType.REQUEST.equals(baseRequest.getDispatcherType()))
{
_requestLog.log(baseRequest, (Response)response);
}
...
}
public void handle(String target, final Request baseRequest, HttpServletRequest request, final HttpServletResponse response)
throws IOException, ServletException
{
...
else
_requestLog.log(baseRequest, (Response)response);
...
}
We can see from above, that in 8.1.11 only DispatcherType.REQUEST type requests were logged, but in
8.1.12 all types of requests are logging.
For our Grails web application it is a problem, because Grails framework uses GrailsContentBufferingResponse for FORWARD-ed type of requests.
We can locally fix it by returning back if check for baseRequest.getDispatcherType(), but I think that this issue can bite other jetty users and better to be fixed in jetty main source tree.
--
Best regards
Igor
View this message in context:
RequestLogHandler in 8.1.12 fails to handle forwarded requests in grails
Sent from the
Jetty User mailing list archive at Nabble.com.