出现错误 java.io.NotSerializedException: org.apache.catalina.session.StandardSessionFacade
我收到错误
java.io.NotSerializedException:org.apache.catalina.session.StandardSessionFacade
我该如何解决此错误?我在 viewScope 中使用 ManagedBeans。还使用过滤器创建会话。是什么原因导致这个异常发生呢?
谢谢
I am getting error
java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade
How can i resolve this error? I am using managedBeans in viewScope. Also creating a session using filter. What causing this exception happening?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
您已引用
HttpSession
作为某些 JSF 托管 bean 类的属性。这是一个极其糟糕的设计。删除它并更改您的方法以仅从线程本地范围内的 FacesContext 获取它。但毕竟,这仍然是一种味道,在正确设计的 JSF 托管 bean 类中,您应该不有任何一行import javax.servlet...
。如何正确解决此问题取决于具体的功能要求,而您的问题根本不清楚这一点。我的第一个猜测是,您实际上需要一个会话范围的托管 bean,它又由 @ManagedProperty 注入。You have referenced a
HttpSession
as a property of some JSF managed bean class. This is an extremely bad design. Remove it and change your approach to just get it from theFacesContext
in the thread local scope. But after all, this is still a smell, in properly designed JSF managed bean classes you should have not have any single line ofimport javax.servlet...
. How to fix this properly depends on the concrete functional requirement which is not clear from your question at all. My first guess would be that you actually need a session scoped managed bean which is in turn injected by@ManagedProperty
.