[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400479#comment-13400479 ]
Jacques Le Roux edited comment on OFBIZ-4289 at 6/25/12 7:47 PM: ----------------------------------------------------------------- == TYPO == I get this also (in a customised instance but not much changed in framework) 2012-06-12 10:35:29,921 (OFBiz_Shutdown_Hook) [ StandardSession.java:1567:WARN ] Cannot serialize session attribute _LAST_VIEW_PARAMS_ for session 00C48D0D76821C98403482FAE8B77C24.jvm1 java.io.NotSerializableException: net.sf.json.JSONObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at javolution.util.FastMap.writeObject(FastMap.java:1513) Do _LAST_VIEW_PARAMS_ is a FastMap<String, Object> returned by UtilHttp.getParameterMap(). I read it implements javolution.xml.XMLSerializable but not sure what this is and the Tomcat StandarManager does not seems to appreciate (StandardSession.java:1567:WARN). We can replace by an HashMap which implements Serializable {code} Index: framework/base/src/org/ofbiz/base/util/UtilHttp.java =================================================================== --- framework/base/src/org/ofbiz/base/util/UtilHttp.java (revision 1353393) +++ framework/base/src/org/ofbiz/base/util/UtilHttp.java (working copy) @@ -113,7 +113,7 @@ */ public static Map<String, Object> getParameterMap(HttpServletRequest request, Set<? extends String> nameSet, Boolean onlyIncludeOrSkip) { boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue(); - Map<String, Object> paramMap = FastMap.newInstance(); + Map<String, Object> paramMap = new HashMap<String, Object>(); // add all the actual HTTP request parameters Enumeration<String> e = UtilGenerics.cast(request.getParameterNames()); {code} I tried it seems to work fine (small test, see attached log) Note that LAST_VIEW_PARAMS was introduced previously to multitenant changes. There are maybe other such Objects put in session, but (quickly) looking around in RequestHandler found none (others are simple String). was (Author: jacques.le.roux): I get this also (in a customised instance but not much cannched for framework) 2012-06-12 10:35:29,921 (OFBiz_Shutdown_Hook) [ StandardSession.java:1567:WARN ] Cannot serialize session attribute _LAST_VIEW_PARAMS_ for session 00C48D0D76821C98403482FAE8B77C24.jvm1 java.io.NotSerializableException: net.sf.json.JSONObject at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) at javolution.util.FastMap.writeObject(FastMap.java:1513) Do _LAST_VIEW_PARAMS_ is a FastMap<String, Object> returned by UtilHttp.getParameterMap(). I read it implements javolution.xml.XMLSerializable but not sure what this is and the Tomcat StandarManager does not seems to appreciate (StandardSession.java:1567:WARN). We can replace by an HashMap which implements Serializable {code} Index: framework/base/src/org/ofbiz/base/util/UtilHttp.java =================================================================== --- framework/base/src/org/ofbiz/base/util/UtilHttp.java (revision 1353393) +++ framework/base/src/org/ofbiz/base/util/UtilHttp.java (working copy) @@ -113,7 +113,7 @@ */ public static Map<String, Object> getParameterMap(HttpServletRequest request, Set<? extends String> nameSet, Boolean onlyIncludeOrSkip) { boolean onlyIncludeOrSkipPrim = onlyIncludeOrSkip == null ? true : onlyIncludeOrSkip.booleanValue(); - Map<String, Object> paramMap = FastMap.newInstance(); + Map<String, Object> paramMap = new HashMap<String, Object>(); // add all the actual HTTP request parameters Enumeration<String> e = UtilGenerics.cast(request.getParameterNames()); {code} I tried it seems to work fine (small test, see attached log) Note that LAST_VIEW_PARAMS was introduced previously to multitenant changes. There are maybe other such Objects put in session, but (quickly) looking around in RequestHandler found none (others are simple String). > Login out on a cluster handled by DeltaManager causes a NPE > ----------------------------------------------------------- > > Key: OFBIZ-4289 > URL: https://issues.apache.org/jira/browse/OFBIZ-4289 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 4.0, Release Branch 09.04, Release Branch > 10.04, Release Branch 11.04, SVN trunk > Environment: Ubuntu > Reporter: Jacques Le Roux > Assignee: Jacques Le Roux > Priority: Critical > Labels: cluster, logout > Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk > > Attachments: OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, OFBIZ-4289_Login_out_on_a > cluster_handled_by_DeltaManager_causes_a_NPE.patch, changeset_2510.diff, > ofbiz.log > > > It works locally but not on clusters. You simply get a NPE. > h3. Problem > * When we logout we cross an issue due to Tomcat sessions persistence. > * Because we set distributable to true, to allow sessions failover, > * and use and DeltaManager for replication. > * Delegator and other main Classes (notably Dispatcher) are not > serialized in OFBiz. This is the origin of the problem > h3. Tried solutions > By default DeltaManager save active sessions on disk. It uses a private > String variable pathname for that (default to "SESSIONS.ser"). You can set it > to null, to avoid session persistence, using a context.xml file in the > WEB-INF folder with content like below. But I tried it in webtools app on > staging qs001 (only) and it did not work (with distributable set to false). > And we have no other means to set it from OFBiz (OOTB). > {code} > <Context> > <Manager className="org.apache.catalina.session.DeltatManager" > pathname=""> > </Manager> > </Context> > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira