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