Increase the lock time for "After 1 minute the Pagemap null is still locked" Exception
org.apache.wicket.protocol.http.request.InvalidUrlException:
org.apache.wicket.WicketRuntimeException:
After 1 minute the Pagemap null is still locked by:
Thread[http-8443-3,5,main], giving up trying to get the page for path: 3:timer
Where is this 1 minute set? Is a wicket setting, or a tomcat? or ...? How can I modify t开发者_如何学编程his?
Although I agree with Martijn's answer (you shouldn't keep users waiting for more than a minute), the timeout can be set by calling WebApplication.getRequestCycleSettings().setTimeout()
on your application object.
Example to set it to 3 Minutes:
WebApplication.get().getRequestCycleSettings().setTimeout(Duration.minutes(3));
Instead of increasing the timeout perhaps ensure for the sanity of your users that the request keeping the page map lock takes less than 1 minute. This can be done by using a job framework like Quartz and submitting a job to it instead of doing the heavy processing in your request listener. This way your user gets an answer quickly and your response times will be much better.
The timeout is a Wicket specific safeguard to prevent bad things from happening. IMO it should be made less rather than increased. Unfortunately many web applications have requests that keep a user waiting for over 10 seconds, so that would become problematic quickly. Using 1 minute is a sensible compromise. AFAIK it is not configurable.
The timeout is a solution for requests that take too long to process, and keeping the page map locked for an extended period of time. Access to the page map is synchronized so that you—the developer—have a single threaded, stateful programming model when working with your components instead of the (dreaded) multithreaded, stateful programming model that made working with servlets so much fun.
In short: don't harm your users, use a job framework to process your long running tasks and offload the processing from your UI.
An alternative solution would be to enable multi window support if the time out is caused by a user having multiple tabs open and using both. This will create multiple page maps and each page map has its own guard.
精彩评论