clone page bean exception.

am importing the view in defalut view in same portlet, importing view having binding methods, geeting below while viewing the imported view.

2010-06-04 10:56:04 CEST (jsf:INFO) [RID:2241] - Failed to clone pagebean for import view: importTemplate1: java.io.NotSerializableException: com.webmethods.caf.CafRelatedParties
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.writeObject(ObjectOutputStream.java:326)
at com.webmethods.caf.faces.component.logic.ImportTemplate.getInternalPageBean(ImportTemplate.java:451)
at com.webmethods.caf.faces.component.logic.ImportTemplate.postPageBeforePhase(ImportTemplate.java:182)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:53)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.propagateEvent(PostPageComponentPhaseListener.java:60)
at com.webmethods.caf.faces.component.PostPageComponentPhaseListener.beforePhase(PostPageComponentPhaseListener.java:28)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:244)
at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:182)
at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:336)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:494)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:220)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:129)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:102)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:181)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:81)
at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:143)
at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:95)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:428)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:400)
at com.webmethods.portal.framework.presentation.renderers.TabulaRasaPortletRenderer.renderPageContent(TabulaRasaPortletRenderer.java:55)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:189)
at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:368)
at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:622)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:462)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:372)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:50)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:42)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:45

all refernce of beans and content provider in curent view having “Specifies whether the session bean expires when the pageflow is out of scope”

Specifies whether the session bean expires when the pageflow is out of scope
Expire With Page Flow
expireWithPageFlow
java.lang.Boolean
true

in faces-config.xml

Hi Anil,
that setting should have nothing to do with the exception. It looks like the class

com.webmethods.caf.CafRelatedParties 

is not serializable. I would add an

implements java.io.Serializable

to that class and see if the exception comes up again.

hope this helps,
Javier

Javier,

Thanks for reply, yes your right it was because of i didnot implement implements java.io.Serializable in com.webmethods.caf.CafRelatedParties class.

regards,
anil kumar ellendula

Hi anilellendula,

    Besides the "normal" exception, I'm also receiving an exception having java.io.NotSerializableException:

(jsf : INFO) [RID:3168] - Failed to clone pagebean for import view: importTemplate: java.io.NotSerializableException: java.lang.reflect.Method
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
at com.webmethods.caf.faces.component.logic.ImportTemplate.getInternalPageBean(ImportTemplate.java:386)
at com.webmethods.caf.faces.component.logic.ImportTemplate.postPageBeforePhase(ImportTemplate.java:157)

    Was this also the case for your problem?

br,
Vlad

Hi Vlad,
Have you a property of type Method in your view bean? If so, you could declare the method name plus its parameters and use Class.getDeclaredMethod(…) instead.

hope this helps,
Javier

Hi Javier,

We do not use java.lang.reflect.Method anywhere in out project.

br,
Vlad

This means that there is a member variable in the included template which isn’t serialiazable. You’ll need to either change that variable to be serializable or declare it as transient.

What often happens is that you have a web service client which will need to be declared transient such as:

private transient app.wsclient.uszip.GetInfoByCity getInfoByCity = null;

Hope this helps.
–mark