HtmlDataTable, NotSerializableException

Hi,

i have a datatable with 3 textareas and an update button, when i click on update i am geoing to a managed bean and could do my business using HtmlDataTable, and then i am coming back to the same page. now if i click on the update.... in the second iteration...i got an exception

[[Faces Servlet]] Servlet.service()for servlet Faces Servlet

threw exception

javax.faces.FacesException: Error calling action method of component with id f1: upd_but

at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio

nListenerImpl.java:74)

the upd_but is the id of my submit button.

Help me...

[690 byte] By [narayanasgsa] at [2007-11-27 3:50:27]
# 1
Where is the NotSerializableException? Could you post the complete exception trace?Looks like your DTOs do not implement "Serializable" interface.
Seshu_Varanasia at 2007-7-12 8:54:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

This is the full stack trace....

18:04:14,562 ERROR [JspStateManagerImpl] Exiting serializeView - Could not seria

lize state: org.apache.myfaces.component.html.ext.HtmlDataTable

java.io.NotSerializableException: org.apache.myfaces.component.html.ext.HtmlData

Table

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)

at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java

:1369)

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13

41)

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav

a:1284)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)

at java.util.HashMap.writeObject(HashMap.java:985)

at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:89

0)

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13

33)

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav

a:1284)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)

at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)

at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)

Help me...

narayanasgsa at 2007-7-12 8:54:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Just a minute of googling gave me this: http://mail-archives.apache.org/mod_mbox/myfaces-users/200601.mbox/%3CW709608949286571137271145@webmail8%3Etry this and see if it works (if you haven't already done this :) )
Seshu_Varanasia at 2007-7-12 8:54:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
can u post your code?srikanth
srikanthga at 2007-7-12 8:54:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

my scenario is like this... i have worksheet.jsp page, which contains list of employees. which is having datatable.

<t:dataTable id="curEmployees" value="#{focal.employeeStates}" var="empstate">

<h:commandLink id="usercomments" action="#{focal.displayUserComments}" >

<h:outputText value="#{empstate.model.employee.emailId}"/>

<f:param name="sid" value="#{empstate.model.employee.personSeqId}"/>

</h:commandLink>

when i click on employee mail id , i am going to usercomments.jsp turu action focal.displayUserComments.

in the usercomments.jsp page i have another datatable, with one update and back button.

<t:dataTable id="curEmployees" value="#{focal.commentstates}" var="comstate" binding="#{focal.modelTable}">

<h:column id="head">

<h:outputText value="#{comstate.model.commentType.commentTypeDesc}"/>

</h:column>

<h:column id="txtarea">

<h:inputTextarea id="comment" value="#{comstate.comment1}" rows="5" cols="40" readonly="#{comstate.model.editable=='N'}"/>

</h:column>

</t:dataTable>

<h:commandLink id="upd_but" action="#{focal.updateComment}" styleClass="button">

<h:graphicImage value="/images/button_update.jpg" styleClass="button" />

</h:commandLink>

<h:outputLink id="dashboard_jump" value="#{facesContext.externalContext.requestContextPath}/pages/worksheet.faces">

<h:graphicImage value="/images/button_back.jpg" styleClass="button" />

</h:outputLink>

managed bean method i am calling when clicked on update button is public String updateComment() throws Exception

{

HttpServletRequest request = getHttpServletRequest();

HttpSession session = request.getSession(false);

pseqid=(String)session.getAttribute("empid");

int count=modelTable.getRowCount();

CommentState cbean[]=new CommentState[count];

for(int i=0;i<count;i++)

{

modelTable.setRowIndex(i);

System.out.println("Model Data ... "+modelTable.getRowData().toString());

cbean[i]=(CommentState)modelTable.getRowData() ;

cbean[i].updateComment(pseqid);

}

return "commentsuccess";

}

here CommentState is a Stateful session bean.

i am getting the above stated error.. when i am clickin on Back button to go back to worksheet page.

Help me...>

narayanasgsa at 2007-7-12 8:54:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...