Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-11922

Nesting an a4j:actionListener in a composite component results in a java.io.NotSerializableException

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 4.1.0.Final
    • Fix Version/s: None
    • Component/s: component-a4j-core
    • Labels:
    • Environment:

      JBoss AS 7.0.2, mojarra 2.1

      Description

      In the code samples below, an a4j:actionListener is nested in a composite component. This results in a java.io.NotSerializableException (stack trace below).

      actionComposite.xhtml
      <composite:interface>
          <composite:actionSource name="button" />
          <composite:attribute name="render" />
          <composite:attribute name="execute" />
          <composite:attribute name="value" />
      </composite:interface>
      
      <composite:implementation>
          <h:commandButton id="button" value="#{cc.attrs.value}">
              <composite:insertChildren />
      
              <f:ajax render="#{cc.attrs.render}" execute="#{cc.attrs.execute}" />
          </h:commandButton>
      </composite:implementation>
      </html>
      
      actionListener.xhtml
      <h:form id="form">
          <h:messages id="messages" />
          <h:panelGrid columns="1">
              <demo:actionComposite render=":form:messages" value="Invoke listener method in composite component">
                  <a4j:actionListener for="button" listener="#{actionListenerBean.handleActionMethodComposite}" />
              </demo:actionComposite>
          </h:panelGrid>
      </h:form>
      
      Stacktrace
      Caused by: java.io.NotSerializableException: org.richfaces.view.facelets.html.ActionListenerHandler
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_26]
      	at java.util.ArrayList.writeObject(ArrayList.java:570) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
      	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
      	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [:1.6.0_26]
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_26]
      	at java.util.ArrayList.writeObject(ArrayList.java:570) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
      	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
      	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_26]
      	at java.util.HashMap.writeObject(HashMap.java:1001) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
      	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
      	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) [:1.6.0_26]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_26]
      	at com.sun.faces.renderkit.ClientSideStateHelper.doWriteState(ClientSideStateHelper.java:325) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      	at com.sun.faces.renderkit.ClientSideStateHelper.writeState(ClientSideStateHelper.java:169) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      	at com.sun.faces.renderkit.ResponseStateManagerImpl.getViewState(ResponseStateManagerImpl.java:135) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
      	... 28 more
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bleathem Brian Leathem
                  Reporter:
                  bleathem Brian Leathem
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: