glassfish
  1. glassfish
  2. GLASSFISH-20247

WELD-001527 Managed bean declaring a passivating scope has a non-serializable interceptor for DefaultInterceptorMetadata

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: cdi
    • Labels:
      None

      Description

      For a bean defined as:

      @Named
      @SessionScoped
      public class MovieClientBean implements Serializable {
      ...
      }

      b83 is throwing the following error:

      SEVERE: Exception while loading the app : CDI deployment failure:WELD-001527 Managed bean declaring a passivating scope has a non-serializable interceptor. Bean: Managed Bean [class org.glassfish.movieplex7.client.MovieClientBean] with qualifiers [@Default @Any @Named] Interceptor: org.jboss.weld.interceptor.reader.DefaultInterceptorMetadata@573da625
      org.jboss.weld.exceptions.DeploymentException: WELD-001527 Managed bean declaring a passivating scope has a non-serializable interceptor. Bean: Managed Bean [class org.glassfish.movieplex7.client.MovieClientBean] with qualifiers [@Default @Any @Named] Interceptor: org.jboss.weld.interceptor.reader.DefaultInterceptorMetadata@573da625

      Deployment fails. This is blocking to run Java EE 7 hands-on lab using b83.

      The complete application is described at http://glassfish.org/hol.

        Activity

        Hide
        TangYong added a comment -

        arungupta, jjsnyder83

        My analyze is as following:

        1 about passivating scope
        Here, needing to notice that in [1], the following from 6.6.3. Passivating scopes,

        "For example, the built-in session and conversation scopes defined in Section 6.7, “Context management for built-in scopes” are passivating scopes. No other built-in scopes are passivating scopes."

        For @SessionScoped, it belongs to "Context management for built-in scopes", so once defining any interceptor or injecting any bean, these interceptors and dependency beans all should be serializable. Although this is from cdi 1.0, in 1.1, this can not be changed.

        [1]:http://docs.jboss.org/cdi/spec/1.0/html_single/#passivatingscope

        2 about @Transactional
        This is an interceptor defining @InterceptorBinding.

        Combining with 1 and 2, the exception happened.

        In reality, previously a similar issue has been discussed in JBOSS community[2],

        [2]: https://community.jboss.org/thread/179828

        [About Fixing]
        Because @Transactional is a part of javax.transaction api, fixing should be limited in the Movie sample, and I am still considering...

        Thanks
        --Tang

        Show
        TangYong added a comment - arungupta, jjsnyder83 My analyze is as following: 1 about passivating scope Here, needing to notice that in [1] , the following from 6.6.3. Passivating scopes, "For example, the built-in session and conversation scopes defined in Section 6.7, “Context management for built-in scopes” are passivating scopes. No other built-in scopes are passivating scopes." For @SessionScoped, it belongs to "Context management for built-in scopes", so once defining any interceptor or injecting any bean, these interceptors and dependency beans all should be serializable. Although this is from cdi 1.0, in 1.1, this can not be changed. [1] : http://docs.jboss.org/cdi/spec/1.0/html_single/#passivatingscope 2 about @Transactional This is an interceptor defining @InterceptorBinding. Combining with 1 and 2, the exception happened. In reality, previously a similar issue has been discussed in JBOSS community [2] , [2] : https://community.jboss.org/thread/179828 [About Fixing] Because @Transactional is a part of javax.transaction api, fixing should be limited in the Movie sample, and I am still considering... Thanks --Tang
        Hide
        TangYong added a comment -

        JavaEE 7 Spec group seemed missing such a scene (combining Transactional Interceptors with CDI beans with Context management for built-in scopes.

        Show
        TangYong added a comment - JavaEE 7 Spec group seemed missing such a scene (combining Transactional Interceptors with CDI beans with Context management for built-in scopes.
        Hide
        jjsnyder83 added a comment -

        Made the transactional interceptors implement Serializable.
        Committed revision 61342.

        Show
        jjsnyder83 added a comment - Made the transactional interceptors implement Serializable. Committed revision 61342.

          People

          • Assignee:
            jjsnyder83
            Reporter:
            arungupta
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: