Details
Description
Blackberry If-Modified-Since date header sometimes has Tomcat's HttpServletRequest.getDateHeader( "If-Modified-Since" ) sending an IllegalArgumentException which crashed Wicket with HTTPStatus -1.
If the If-Modified-Since header can't be parsed, the best is to assume it is null instead of crashing.
To allow this, you can change the following code in org.apache.wicket.request.http.WebRequest :
public final Time getIfModifiedSinceHeader()
{ return getDateHeader("If-Modified-Since"); }with :
public final Time getIfModifiedSinceHeader()
{
try
catch(IllegalArgumentException iae)
{ return null; }}
My stack trace is :
java.lang.IllegalArgumentException: Mo, 12 Sep 2011 20:22:18 GMT
at org.apache.catalina.connector.Request.getDateHeader(Request.java:2025)
at org.apache.catalina.connector.RequestFacade.getDateHeader(RequestFacade.java:681)
at org.apache.wicket.protocol.http.servlet.ServletWebRequest.getDateHeader(ServletWebRequest.java:214)
at org.apache.wicket.request.http.WebRequest.getIfModifiedSinceHeader(WebRequest.java:102)
at org.apache.wicket.request.resource.AbstractResource$ResourceResponse.dataNeedsToBeWritten(AbstractResource.java:302)
at org.apache.wicket.request.resource.PackageResource.newResourceResponse(PackageResource.java:237)
at org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:477)
at org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77)
at org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:723)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253)
at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.seanergie.filter.persistence.SessionsManagerFilter.doFilter(SessionsManagerFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:185)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:269)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:300)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Request Header :
user-agent: BlackBerry9000/5.0.0.411 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/130
profile: http://www.blackberry.net/go/mobile/profiles/uaprof/9000_umts/5.0.0.rdf
referer: http://www.windsofdubai.com/winds/forecasts
if-modified-since: Mo, 12 Sep 2011 20:22:18 GMT
host: www.windsofdubai.com
cookie: __utmc=54148142; __utmb=54148142.3.10.1315926864; __utmz=54148142.1315920781.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=54148142.648980198.1315920781.1315920781.1315926864.2