That seems to work. Thanks a lot, Mike!!!
Another question just to make my understanding of things consistent:
How come the data isn't lost, when the session is serialized but this
field is transient? Isn't keeping the state the whole purpose of the
StateManager serializing the bean? Would it make more sense to make the
object serializable or transient? I'm confused...
Cheers,
Navid
Mike Kienenberger wrote:
session-scoped backing beans are going to be serialized into your session.
Any properties not marked transient on a serialized object are also
going to be serialized.
Try marking your object reference as transient.
Converters are used to convert objects into string representations on
your components stored in the html response (ie, the form values), and
vise-versa.
They don't directly interact with session-scoped backing beans.
On 9/29/05, Navid Vahdat <[EMAIL PROTECTED]> wrote:
The Object is not marked transient -- as is no other. It's part of a
property of a component's backing bean. AFAIK you're not forced to mark
them transient, are you?
What is trying to serialize them is quite obvious from the stack trace.
It's the State Manager. The question is why! And why doesn't it call the
converter? My converter would provite it with a beautifully serializable
String.
Mike Kienenberger wrote:
Is your non-serialiable object marked as transient in your
session-scoped bean? If not, it'll be serialized...
I think the first thing you'll want to do is to determine what is
trying to serialize it. Is it a managed bean or a component?
On 9/29/05, Navid Vahdat <[EMAIL PROTECTED]> wrote:
Just bringing this subject up once more. Somebody able to say something
about it?
Navid Vahdat wrote:
Hi Luca,
the relevant JSP code is
<tr>
<td>*<h:outputLabel for="" value="DataType"/>:</td>
<td>
<table class="spreadingTable">
<tbody>
<tr>
<td class="left"><h:outputText
id="type_name" value="#{editListBean.dataObject.type.name}"
title="#{editListBean.dataObject.type.description}"/><h:inputHidden
id="type" value="#{editListBean.dataObject.type}" required="true"
converter="datatypeConverter" /></td>
<td>
<h:commandLink rendered="true"
action="" id="selectDataTypeLink"
immediate="true">
<h:graphicImage rendered="true"
url="" id="selectDataTypeImage" alt="small
looking glass" title="select typefilter"/>
</h:commandLink>
</td>
</tr>
</tbody>
</table>
<t:message for="" styleClass="error" />
</td>
</tr>
please find the whole JSP attached.
editListBean is a session scope bean that holds a dataobject -- a detail of
a master/detail relationship. This data object has a type, which can be the
below metamodel.ListType it has a name, a description and a couple of other
fields. The type is set in the selectDataType Dialog, which is opened with
the small looking glass to the right of the output text.
Thanks!
Navid
Luca Conte wrote:
Can U post the jsp code?
Navid Vahdat ha scritto:
Can somebody give me a hand on this? The Exception seems to be
connected to using a h:inputhidden with a custom converter. When the
value is null, everithing is fine. When the value is set to an object
(in this case metamodel.ListType), rendering the page is fine, but
triggering a UICommand that is not immediate causes the Exception.
I'm stuck. Is this a known bug?
Navid
Navid Vahdat wrote:
Guys, I get this not serializable exception. The exception is
correct, because metamodel.ListType, a value in a hidden field with a
working converter, definitely is not serializable. Why is myFaces
(ver. 1.1.0) trying to serialize it?
Thanks,
Navid
28.09.2005 10:26:51 org.apache.myfaces.util.StateUtils
encode64
SCHWERWIEGEND: Cannot encode Object with Base64
_java.io.NotSerializableException_: metamodel.ListType
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1054_)
at
java.io.ObjectOutputStream.writeArray(_ObjectOutputStream.java:1224_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1050_)
at
java.io.ObjectOutputStream.writeArray(_ObjectOutputStream.java:1224_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1050_)
at
java.io.ObjectOutputStream.writeArray(_ObjectOutputStream.java:1224_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1050_)
at
java.io.ObjectOutputStream.writeObject(_ObjectOutputStream.java:278_)
at java.util.ArrayList.writeObject(_ArrayList.java:529_)
at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_)
at java.lang.reflect.Method.invoke(_Method.java:324_)
at
java.io.ObjectStreamClass.invokeWriteObject(_ObjectStreamClass.java:809_)
at
java.io.ObjectOutputStream.writeSerialData(_ObjectOutputStream.java:1296_)
at
java.io.ObjectOutputStream.writeOrdinaryObject(_ObjectOutputStream.java:1247_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1052_)
at
java.io.ObjectOutputStream.writeArray(_ObjectOutputStream.java:1224_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1050_)
at
java.io.ObjectOutputStream.writeObject(_ObjectOutputStream.java:278_)
at java.util.ArrayList.writeObject(_ArrayList.java:529_)
at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:25_)
at java.lang.reflect.Method.invoke(_Method.java:324_)
at
java.io.ObjectStreamClass.invokeWriteObject(_ObjectStreamClass.java:809_)
at
java.io.ObjectOutputStream.writeSerialData(_ObjectOutputStream.java:1296_)
at
java.io.ObjectOutputStream.writeOrdinaryObject(_ObjectOutputStream.java:1247_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1052_)
at
java.io.ObjectOutputStream.writeArray(_ObjectOutputStream.java:1224_)
at
java.io.ObjectOutputStream.writeObject0(_ObjectOutputStream.java:1050_)
at
java.io.ObjectOutputStream.writeObject(_ObjectOutputStream.java:278_)
at
org.apache.myfaces.util.StateUtils.encode64(_StateUtils.java:33_)
at
org.apache.myfaces.renderkit.html.HtmlResponseStateManager.writeState(_HtmlResponseStateManager.java:104_)
at
org.apache.myfaces.application.jsp.JspStateManagerImpl.writeState(_JspStateManagerImpl.java:268_)
at
org.apache.myfaces.taglib.core.ViewTag.doAfterBody(_ViewTag.java:160_)
at
org.apache.jsp.EditList_jsp._jspx_meth_f_view_0(_EditList_jsp.java:201_)
at
org.apache.jsp.EditList_jsp._jspService(_EditList_jsp.java:128_)
at
org.apache.jasper.runtime.HttpJspBase.service(_HttpJspBase.java:94_)
at
javax.servlet.http.HttpServlet.service(_HttpServlet.java:802_)
at
org.apache.jasper.servlet.JspServletWrapper.service(_JspServletWrapper.java:324_)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(_JspServlet.java:292_)
at
org.apache.jasper.servlet.JspServlet.service(_JspServlet.java:236_)
at
javax.servlet.http.HttpServlet.service(_HttpServlet.java:802_)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:237_)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:157_)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(_ApplicationDispatcher.java:704_)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(_ApplicationDispatcher.java:474_)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(_ApplicationDispatcher.java:409_)
at
org.apache.catalina.core.ApplicationDispatcher.forward(_ApplicationDispatcher.java:312_)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(_ServletExternalContextImpl.java:415_)
at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(_JspViewHandlerImpl.java:234_)
at
org.apache.myfaces.lifecycle.LifecycleImpl.render(_LifecycleImpl.java:300_)
at
javax.faces.webapp.FacesServlet.service(_FacesServlet.java:95_)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:237_)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:157_)
at
org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:214_)
at
org.apache.catalina.core.StandardValveContext.invokeNext(_StandardValveContext.java:104_)
at
org.apache.catalina.core.StandardPipeline.invoke(_StandardPipeline.java:520_)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(_StandardContextValve.java:198_)
at
org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:152_)
at
org.apache.catalina.core.StandardValveContext.invokeNext(_StandardValveContext.java:104_)
at
org.apache.catalina.core.StandardPipeline.invoke(_StandardPipeline.java:520_)
at
org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:137_)
at
org.apache.catalina.core.StandardValveContext.invokeNext(_StandardValveContext.java:104_)
at
org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:118_)
at
org.apache.catalina.core.StandardValveContext.invokeNext(_StandardValveContext.java:102_)
at
org.apache.catalina.core.StandardPipeline.invoke(_StandardPipeline.java:520_)
at
org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
at
org.apache.catalina.core.StandardValveContext.invokeNext(_StandardValveContext.java:104_)
at
org.apache.catalina.core.StandardPipeline.invoke(_StandardPipeline.java:520_)
at
org.apache.catalina.core.ContainerBase.invoke(_ContainerBase.java:929_)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(_CoyoteAdapter.java:160_)
at
org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:799_)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(_Http11Protocol.java:705_)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(_PoolTcpEndpoint.java:577_)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(_ThreadPool.java:683_)
at java.lang.Thread.run(_Thread.java:534_)
________________________________
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"
prefix="t"%>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="">
<title>Common Enterprise Integration Service Repository -- Edit
List</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" href="" type="text/css" />
</head>
<body>
<f:view>
<f:loadBundle basename="resources.validation_messages" var="messages"/>
<table>
<tbody>
<tr>
<td colspan="2" rowspan="1" class="head">
<jsp:include page="head.jsp"/>
</td>
</tr>
<tr>
<td class="menu">
<jsp:include page="menu.jsp"/>
</td>
<td class="content">
<t:messages id="messageList" styleClass="generalerror" showDetail="true"
globalOnly="true"/>
<h1>Create/Change/Delete ListType</h1>
<h:form>
<table>
<tbody>
<tr>
<td>*<h:outputLabel for="" value="Name"/>:</td>
<td><h:inputText id="name" value="#{editListBean.dataObject.name}"
required="true"/><t:message for="" styleClass="error"/></td>
</tr>
<tr>
<td>*<h:outputLabel for="" value="Version"/>:</td>
<td><h:inputText id="version" value="#{editListBean.dataObject.version}"
required="true"/><t:message for="" styleClass="error"/></td>
</tr>
<tr>
<td>*<h:outputLabel for="" value="DataType"/>:</td>
<td>
<table class="spreadingTable">
<tbody>
<tr>
<td class="left"><h:outputText id="type_name"
value="#{editListBean.dataObject.type.name}"
title="#{editListBean.dataObject.type.description}"/><h:inputHidden
id="type" value="#{editListBean.dataObject.type}" required="true"
converter="datatypeConverter" /></td>
<td>
<h:commandLink rendered="true" action=""
id="selectDataTypeLink" immediate="true">
<h:graphicImage rendered="true" url=""
id="selectDataTypeImage" alt="small looking glass" title="select
typefilter"/>
</h:commandLink>
</td>
</tr>
</tbody>
</table>
<t:message for="" styleClass="error" />
</td>
</tr>
<tr>
<td>MinLength:</td>
<td><h:inputText
value="#{editListBean.dataObject.minLength}"
required="false" rendered="true"/></td>
</tr>
<tr>
<td>MaxLength:</td>
<td><h:inputText
value="#{editListBean.dataObject.maxLength}"
required="false" rendered="true"/></td>
</tr>
</tbody>
</table>
<br>
Description:
<br>
<h:inputTextarea
value="#{editListBean.dataObject.description}" rows="10"
cols="50" rendered="true" required="false"/>
<br>
<br>
<f:subview id="createButtonBar" rendered="#{editListBean.create}">
<h:commandButton value="Create" action=""
rendered="true"/>
<h:commandButton value="Cancel" action=""
immediate="true" rendered="true"/>
</f:subview>
<f:subview id="updateButtonBar"
rendered="#{!editListBean.create}">
<h:commandButton value="Delete" action=""
rendered="true"
disabled="#{!editListBean.dataObject.deletable}"
immediate="true"/>
<h:commandButton value="Update" action=""
rendered="true"/>
<h:commandButton value="Cancel" action=""
immediate="true" rendered="true"/>
</f:subview>
</h:form>
</td>
</tr>
</tbody>
</table>
</f:view>
</body>
</html>
|
- Re: NotSerializableException Navid Vahdat
-