Details
Description
When Tomcat is configured to replicate sessions on startup and shutdown it will attempt to serialize anything in the session not marked transient. ICEfaces does not yet support session replication, but should still mark non-serializable classes as transient.
Some currently identified classes/interfaces needing review:
com.icesoft.faces.ResponseState
com.icesoft.faces.webapp.xmlhttp.ResponseState
com.icesoft.faces.PersistentFacesState
com.icesoft.faces.sessionAuxiliaryData
Some currently identified classes/interfaces needing review:
com.icesoft.faces.ResponseState
com.icesoft.faces.webapp.xmlhttp.ResponseState
com.icesoft.faces.PersistentFacesState
com.icesoft.faces.sessionAuxiliaryData
Issue Links
Activity
Philip Breau
created issue -
Philip Breau
made changes -
Field | Original Value | New Value |
---|---|---|
Environment | windows xp |
Ken Fyten
made changes -
Fix Version/s | 1.6DR#4 [ 10060 ] | |
Fix Version/s | 1.6 [ 10031 ] | |
Assignee Priority | P2 |
Ken Fyten
made changes -
Fix Version/s | 1.6 [ 10031 ] | |
Fix Version/s | 1.6DR#4 [ 10060 ] |
Ken Fyten
made changes -
Assignee | Ted Goddard [ ted.goddard ] | Mircea Toma [ mircea.toma ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #14013 | Tue May 29 17:02:26 MDT 2007 | mircea.toma | Wrap values to avoid Tomcat serialization warnings -- |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletSessionMap.java
|
Mircea Toma
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Mircea Toma
made changes -
Ted Goddard
made changes -
Resolution | Fixed [ 1 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |
Assignee Priority | P2 | P1 |
Assignee | Mircea Toma [ mircea.toma ] | Judy Guglielmin [ judy.guglielmin ] |
Mircea Toma
made changes -
Ken Fyten
made changes -
Assignee | Judy Guglielmin [ judy.guglielmin ] | Mircea Toma [ mircea.toma ] |
Mircea Toma
made changes -
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Issue Type | Bug [ 1 ] | Improvement [ 4 ] |
Ken Fyten
made changes -
Fix Version/s | 1.6DR#6 [ 10090 ] | |
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Fix Version/s | 1.6 [ 10031 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 | |
Assignee | Mircea Toma [ mircea.toma ] |
the following changes seem to make all of the exceptions go away. Tomcat tries to serialize anything put in the session of a distributed web app, so there's a problem with putting the UIViewRoot directly into the session as it's not serializable.
BlockingResponseState:
private transient Object eventLock = new Object();
protected transient HttpSession session;
PersistentFacesState:
transient FacesContext facesContext;
+++ C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\context\SerializableUIViewRootWrapper.java 2007-02-21 17:01:58.000000000 -0700
@@ -0,0 +1,22 @@
+package com.icesoft.faces.context;
+
+import java.io.Serializable;
+import javax.faces.component.UIViewRoot;
+
+public class SerializableUIViewRootWrapper implements Serializable
— C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\application\D2DViewHandler.java 2007-01-24 18:16:26.000000000 -0700
+++ C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\application\D2DViewHandler.java 2007-02-22 09:46:46.000000000 -0700
@@ -33,12 +33,13 @@
package com.icesoft.faces.application;
import com.icesoft.faces.context.BridgeExternalContext;
{ return delegate.createView(context, viewId); }import com.icesoft.faces.context.BridgeFacesContext;
import com.icesoft.faces.context.DOMResponseWriter;
+import com.icesoft.faces.context.SerializableUIViewRootWrapper;
import com.icesoft.faces.env.CommonEnvironmentResponse;
import com.icesoft.faces.webapp.parser.JspPageToDocument;
import com.icesoft.faces.webapp.parser.Parser;
import com.icesoft.faces.webapp.xmlhttp.BlockingServlet;
import com.icesoft.faces.webapp.xmlhttp.PersistentFacesCommonlet;
import com.icesoft.util.SeamUtilities;
@@ -183,28 +184,28 @@
if (delegateView(viewId))
UIViewRoot root = new UIViewRoot();
{ root.setViewId("default"); context.setViewRoot(root); contextServletTable - .put(DOMResponseWriter.RESPONSE_VIEWROOT, root); + .put(DOMResponseWriter.RESPONSE_VIEWROOT, viewRootWrapper); Locale locale = calculateLocale(context); root.setLocale(locale); return root; }root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
-
+ SerializableUIViewRootWrapper viewRootWrapper = new SerializableUIViewRootWrapper(root);
Map contextServletTable =
D2DViewHandler.getContextServletTable(context);
if (null == viewId)
root.setViewId(viewId);
context.setViewRoot(root);
+ contextServletTable.put(DOMResponseWriter.RESPONSE_VIEWROOT, viewRootWrapper);
return root;
// return restoreView(context, viewId);
}
/**
@@ -276,14 +277,17 @@
contextServletTable.put(DOMResponseWriter.RESPONSE_CONTEXTS_TABLE,
domResponseContexts);
}
UIViewRoot root = null;
+ SerializableUIViewRootWrapper viewRootWrapper = ((SerializableUIViewRootWrapper) contextServletTable
+ .get(DOMResponseWriter.RESPONSE_VIEWROOT));
+ if( viewRootWrapper != null ) { + root = viewRootWrapper.getViewRoot(); + }
if ((null != root) && (null != viewId)) {
{ // return root; }if (D2DViewHandler.mungeViewId(viewId)
.equals(D2DViewHandler.mungeViewId(root.getViewId())))
— C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\context\BridgeFacesContext.java 2006-10-25 13:11:10.000000000 -0700
+++ C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\context\BridgeFacesContext.java 2007-02-22 10:16:27.000000000 -0700
@@ -212,39 +212,46 @@
public void setResponseWriter(ResponseWriter responseWriter)
{ this.responseWriter = responseWriter; }+ private transient SerializableUIViewRootWrapper viewRootWrapper;
public UIViewRoot getViewRoot() {
+ if (null == viewRootWrapper) {
Map contextServletTable = getContextServletTable();
if (null != contextServletTable) { - viewRoot = (UIViewRoot) contextServletTable + viewRootWrapper = (SerializableUIViewRootWrapper) contextServletTable .get(DOMResponseWriter.RESPONSE_VIEWROOT); }
-
+ else { + + }
+ }
+ if( viewRootWrapper == null )
+ viewRootWrapper = new SerializableUIViewRootWrapper(null);
+ return viewRootWrapper.getViewRoot();
}
public void setViewRoot(UIViewRoot viewRoot) {
+
+ this.viewRootWrapper = new SerializableUIViewRootWrapper(viewRoot);
+
+ //pointing this FacesContext to the new view
Map contextServletTable = getContextServletTable();
if (null != contextServletTable)
responseWriter = null;
+
}
private static final Log log = LogFactory.getLog(BridgeFacesContext.class);
String iceFacesId;
public String getIceFacesId()
{ --- C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\context\DOMResponseWriter.java 2007-01-15 15:08:20.000000000 -0700 +++ C:\work\frameworks\ICEfaces-1.5.3-src\icefaces\core\src\com\icesoft\faces\context\DOMResponseWriter.java 2007-02-22 09:51:18.000000000 -0700 @@ -166,13 +166,13 @@ domResponseContexts = new HashMap(); contextServletTable.put(DOMResponseWriter.RESPONSE_CONTEXTS_TABLE, domResponseContexts); }// viewroot, application
contextServletTable.put(DOMResponseWriter.RESPONSE_VIEWROOT,
+ new SerializableUIViewRootWrapper(context.getViewRoot()));
cursor = document = DOCUMENT_BUILDER.newDocument();
contextServletTable.put(DOMResponseWriter.RESPONSE_DOM, document);
boolean streamWritingParam = "true".equalsIgnoreCase(
context.getExternalContext().getInitParameter(
DOMResponseWriter.STREAM_WRITING));
DOMResponseWriter.isStreamWritingFlag =