Bauke Scholtz created MYFACES-4057:
--------------------------------------
Summary: Serializable ViewScopeContextualStorage references
non-serializable BeanManager
Key: MYFACES-4057
URL: https://issues.apache.org/jira/browse/MYFACES-4057
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 2.2.10
Environment: TomEE 7.0.0 and 7.0.1
Reporter: Bauke Scholtz
Test case:
1. Have this CDI bean with JSF CDI view scope.
{code}@Named @ViewScoped
public class Bean implements Serializable {}{code}
2. Have this minimal page mapped to JSF servlet.
{code}<!DOCTYPE html>#{bean}{code}
3. Open this page in a server using OpenWebBeans as CDI implementation (TomEE
for example) and have session persistence enabled (already default in TomEE).
4. Restart the server.
5. On shutdown below warning is logged.
{code}
ARNING: Cannot serialize session attribute openWebBeansSessionContext for
session 34F40C623600849F43AD2153F2EB75D8
java.io.NotSerializableException: org.apache.webbeans.container.BeanManagerImpl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
...{code}
6. After restart below exception is thrown during deserializing session (stack
trace comes from TomEE 7.0.0).
{code}java.lang.NullPointerException
at
org.apache.webbeans.proxy.NormalScopeProxyFactory.createNormalScopeProxy(NormalScopeProxyFactory.java:121)
at
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.readResolve(NormalScopedBeanInterceptorHandler.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
{code}
Root cause appears to be that the serializable
{{org.apache.myfaces.cdi.view.ViewScopeContextualStorage}} class has a
{{BeanManager}} property while the interface is not declared serializable.
Related: https://issues.apache.org/jira/browse/OWB-1123
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)