Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4057

Serializable ViewScopeContextualStorage references non-serializable BeanManager

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.10
    • 2.2.11
    • None
    • None
    • TomEE 7.0.0 and 7.0.1

    Description

      1. Have this CDI bean with JSF CDI view scope.

      @Named @ViewScoped
      public class Bean implements Serializable {}

      2. Have this minimal page mapped to JSF servlet.

      <!DOCTYPE html>#{bean}

      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.

      WARNING: Cannot serialize session attribute openWebBeansSessionContext for session 34F40C623600849F43AD2153F2EB75D8
      java.io.NotSerializableException: org.apache.webbeans.container.BeanManagerImpl
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      	...

      6. After restart below exception is thrown during deserializing session (stack trace comes from TomEE 7.0.0).

      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)
      	...
      

      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

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            balusc Bauke Scholtz
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: