Liberty Web应用程序ViewExpiredException-无法为视图标识符找到已保存的视图状态 [英] Liberty Web application ViewExpiredException - No saved view state could be found for the view identifier

查看:171
本文介绍了Liberty Web应用程序ViewExpiredException-无法为视图标识符找到已保存的视图状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到很多类似案例,但是我相信我的问题可能有所不同.我已经找到了原因,但是还没有找到解决方法.我在三个不同区域的CICS中运行3个自由服务器,所有服务器都使用相同的捆绑包启动Web应用程序.该Web应用程序可以完全正常运行并且运行良好,但是当所有三个服务器都在三个不同区域中启动并运行时,该应用程序将获得ViewExpiredException.我已经证明,这是通过关闭两台服务器并尝试复制该问题而没有成功而发生此问题的原因.

I've seen many posts for this similar case but I believe my issue may be different. I have figured out the cause but have not yet figured out how to fix it. I am running a 3 liberty servers in CICS in three different regions, all using the same bundle to launch the web application. The web application is fully operational and functions fine, but when all three servers are up and running in the three different regions, the application gets the ViewExpiredException. I have proven that this is why the issue occurs by shutting down two of the servers and attempting to replicate the issue with no success.

关于我的代码,如果需要,我可以发布任何代码.就像我说的那样,该应用程序可以100%运行,但是仅当一台服务器正在使用它时.我的所有方法类都是会话范围的,但数据库操作类是应用程序范围的.我相信工作负载管理会导致当前会话偶尔在服务器之间跳转,并且这样做会导致错误.如果有人知道如何解决此问题,我将不胜感激.非常感谢!

In regard to my code, I can post any if needed. As I said, the application is 100 percent operational, but only when one server is using it. All of my method classes are session scoped, except for my database operations class, which is application scoped. I believe workload management causes the current session to occasionally jump between servers, and doing so causes the error. If anyone knows how to fix this I will be very grateful. Thanks so much!

我正在发布堆栈跟踪.

Caused by: javax.faces.application.ViewExpiredException: /main.xhtml - No saved view state could be found for the view identifier: /main.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:183)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1255)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:743)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:440)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1156)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1004)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:76)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:921)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:281)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:960)
at com.ibm.cics.wlp.impl.CICSHttpRunnable.run(CICSHttpRunnable.java:244)
at com.ibm.cics.wlp.impl.CICSTaskWrapper.runWork(CICSTaskWrapper.java:701)
at com.ibm.cics.wlp.impl.CICSTaskWrapper.run(CICSTaskWrapper.java:386)

推荐答案

我想我可能已经找到了解决方案.此问题可能是由于状态保存方法设置为服务器引起的.我已将其添加到代码的web.xml中:

I think I may have found a solution. This issue may be due to the state saving method being set to server. I have added this to the web.xml of my code:

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>

据我所知,由于应用程序在服务器之间跳转,因此发生异常是因为状态保存方法是服务器端的,因此当我们访问另一台服务器时会丢失该异常.将方法更改为客户端可能会解决此问题.

To my understanding, since the application is jumping between servers, the exception occurs because the state saving method was server side, so it is lost when we travel to another server. Changing the method to client may resolve this issue.

我目前正在尝试复制该问题.如果无法执行此操作,我将选择它作为解决方案.

I am currently attempting to replicate the issue. If I am unable to do so, I will select this as the solution.

这篇关于Liberty Web应用程序ViewExpiredException-无法为视图标识符找到已保存的视图状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆