glassfish
  1. glassfish
  2. GLASSFISH-15407

Serialization of an injected Weld property fails in clustered environment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1_b35
    • Fix Version/s: None
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Windows 7/Windows 2008, clustered (2 local instances)

      Description

      I'm having trouble with a controller class accessed from a JSF page.
      When a SLF4J Logger gets injected by Weld, the serialization fails in a clustered GF 3.1 environment. The following error lines appear in the logfile of the instance:

      [#|2010-12-31T15:38:22.071+0100|INFO|glassfish3.1|org.apache.catalina.session.ManagerBase|_ThreadID=16;_ThreadName=Thread-1;|PWC2785: Cannot serialize session attribute org.jboss.weld.context.http.HttpSessionContext#org.jboss.weld.bean-/D:/glassfish-3.1-b32/glassfish/nodes/localhost/mls1/applications/myliquidsuite/myliquidsuite-web_war/-ManagedBean-class nl.asknow.liquidplatform.myliquidsuite.application.businfra.controller.VisitorController for session cd3761b77db86b3dbe76ae7b5057
      java.io.NotSerializableException: java.util.logging.Logger
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      ...

      Some relevant code of the VisitorController:
      import org.slf4j.Logger;

      @Named
      @SessionScoped
      public class VisitorController implements Serializable

      { /** * uid */ private static final long serialVersionUID = -4647906892075275641L; @Inject protected transient Logger log; ... }

      Notice that the injected org.slf4j.Logger is an slfj4 logger and not a java.util.logging.Logger (as mentioned in the error).
      When I remove the log property, everything works just fine. Also when I assign a Logger using a LogFactory directly, everything seems to work fine. So for example:

      protected transient Logger log = LoggerFactory.getLogger(VisitorController.class);

      does work well.

      This problem looks a lot like http://java.net/jira/browse/GLASSFISH-15395, which refers to https://issues.jboss.org/browse/WELD-812. I already had a little discussion about it with Pete Muir (see comments https://issues.jboss.org/browse/WELD-812).

        Activity

        Hide
        Sivakumar Thyagarajan added a comment -

        Could you please provide a sample application and please try against latest GF3.1 (after commit 44200) and let us know the results? We integrated a new Weld release (Weld 1.1.0.CR4) in commit 44200 which has made some changes around serialization and deserialization of Bean proxies.

        Show
        Sivakumar Thyagarajan added a comment - Could you please provide a sample application and please try against latest GF3.1 (after commit 44200) and let us know the results? We integrated a new Weld release (Weld 1.1.0.CR4) in commit 44200 which has made some changes around serialization and deserialization of Bean proxies.
        Hide
        Ramon Rockx added a comment -

        Sivakumar, is this fix (commit 44200) part of the latest nightly build (january 3th)?

        Show
        Ramon Rockx added a comment - Sivakumar, is this fix (commit 44200) part of the latest nightly build (january 3th)?
        Hide
        Ramon Rockx added a comment -

        Tested this issue with promoted build 36, problem seems to be solved.
        Thank you!

        Show
        Ramon Rockx added a comment - Tested this issue with promoted build 36, problem seems to be solved. Thank you!
        Hide
        Sivakumar Thyagarajan added a comment -

        Marking as weld-int-required as this issue does not appear with the SNAPSHOT version of Weld 1.1. Weld 1.1 has fixes for GLASSFISH-15278 (Conversation session serialization) and this appears to resolve this issue as well

        Show
        Sivakumar Thyagarajan added a comment - Marking as weld-int-required as this issue does not appear with the SNAPSHOT version of Weld 1.1. Weld 1.1 has fixes for GLASSFISH-15278 (Conversation session serialization) and this appears to resolve this issue as well
        Hide
        Sivakumar Thyagarajan added a comment -

        Just noticed that the bug submitter (rockxwre) indicates [1] that this issue does not appear with latest 3.1 trunk build and hence closing this issue

        [1] http://java.net/jira/browse/GLASSFISH-15407?focusedCommentId=189519&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_189519

        Show
        Sivakumar Thyagarajan added a comment - Just noticed that the bug submitter (rockxwre) indicates [1] that this issue does not appear with latest 3.1 trunk build and hence closing this issue [1] http://java.net/jira/browse/GLASSFISH-15407?focusedCommentId=189519&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_189519

          People

          • Assignee:
            Sivakumar Thyagarajan
            Reporter:
            Ramon Rockx
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: