升级到jsf2后ViewExpiredException
我们最近将主要平台从 jsf 1.2 升级到 2.0。升级后,我们每小时都会收到几个 ViewExpiredException 错误。从阅读该主题来看,这似乎是会话过期时的预期异常,但是我们检查了访问日志,即使在某些情况下请求仅相隔 5 分钟,我们也会收到这些异常。
我的问题如下:
1)除了会话过期之外,还有哪些条件可能导致ViewExpiredException?
2) 我们记录的异常不包含有关导致异常的确切条件的详细信息(会话丢失、会话损坏、无法恢复特定组件)。有没有办法引入额外的日志记录来找出在每种情况下触发此异常的非常具体的情况?
莫贾拉2.0.4-b09 雄猫6 使用 Memcached 会话管理器进行会话复制
感谢任何帮助。谢谢!
We recently upgraded a major platform from jsf 1.2 to 2.0. After upgrading we're getting several ViewExpiredException errors each hour. From reading up on the topic it seems that this is an expected exception when sessions expire, however we've reviewed the access logs and we are getting these exceptions even when requests are only 5 minutes apart in some cases.
My questions are as follows:
1) Other than session expiration, what other conditions might cause ViewExpiredException?
2) The exception we're logging doesn't contain much detail about the exact condition that is causing the exception (missing session, corrupt session, unable to restore a particular component). Is there a way to introduce additional logging to find out the very specific situation that is triggering this exception in each case?
Mojarra 2.0.4-b09
Tomcat 6
Using Memcached Session Manager for session replication
Any help is appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终用户在会话中请求/创建了太多视图,并且正在提交到旧视图。每个会话的默认最大浏览次数为 15。换句话说,如果最终用户在同一会话中使用表单在页面上打开 16 个浏览器窗口/选项卡并提交到第一个,则用户可能会收到
ViewExpiredException.
每个会话的最大浏览次数可在
web.xml
中配置,另请参阅 Mojarra 常见问题解答。
不是通过 JSF 和/或
ViewExpiredException
。整个异常仅意味着视图不再存在于会话中。这确实可能有更多根本原因。使用HttpSessionListener 记录会话创建和销毁
并通过HttpSessionAttributeListener
可能会有所帮助。更新 根据评论,在包含表单的缓存页面上按浏览器后退按钮,然后提交表单,当视图过期时,确实也会导致
ViewExpiredException
。这可以通过以下两种方式解决,最好结合使用它们:有关更多详细信息,请参阅此答案。
The enduser has requested/created too much views within a session and is submitting to an old view. The default max views per session is 15. In other words, if the enduser opens 16 browser windows/tabs on a page with a form within the same session and submits to the first one, then the user can get
ViewExpiredException
.The max views per session is configureable in
web.xml
bySee also Mojarra FAQ for other parameters.
Not through JSF and/or a
ViewExpiredException
. The whole exception just means that the view is not present in the session anymore. This can in turn indeed have more underlying causes. Logging the session creation and destroy using aHttpSessionListener
and logging the session attribute modifications byHttpSessionAttributeListener
may be helpful.Update as per the comments, pressing the browser back button on a cached page containing a form and then submitting the form thereafter could indeed also cause
ViewExpiredException
when the view is been expired. This can be solved in following two ways, preferably in a combination of them:For more detail, see this answer.