|
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4289. ---------------------------------- Resolution: Later > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reopened OFBIZ-4289: ------------------------------------ OK, the NPE is a real problems when you set <distributable/> in concerned applications > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400107#comment-13400107 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- Also if you try to put aside security you get: org.ofbiz.webapp.event.EventHandlerException: Problems processing event: java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute security (setAttribute: Non-serializable attribute security) > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400108#comment-13400108 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- So I think we should better reload security when it's missing than hidding these real issues > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400106#comment-13400106 ] Jacques Le Roux edited comment on OFBIZ-4289 at 6/24/12 7:37 AM: ----------------------------------------------------------------- == TYPO == OK, the NPE is really a blocking problem when you set <distributable/> in concerned applications was (Author: jacques.le.roux): OK, the NPE is a real problems when you set <distributable/> in concerned applications > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux updated OFBIZ-4289: ----------------------------------- Attachment: OFBIZ-4289_Login_out_on_a cluster_handled_by_DeltaManager_causes_a_NPE.patch I believe this patch is finally the right way to do it. At least I don't see a better/simpler way... There were no needs to reload security when missing. I simply did it too fast, and was not keeping security and authz in the request. It's much more simple now and only dependent on apps-distributable in catalina-container. Please review and test > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400118#comment-13400118 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- Ha wait, I will remove the dependency on Config.java, like I did in earlier patches... > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400119#comment-13400119 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- Mmm, then you have to hardcode the containers file name :/. I keep it as is... > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400121#comment-13400121 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ A few comments: * the name of the argument "persistSerialized" (in setWebContextObjects method) is confusing and could be renamed to "distributableApplication", it will make the code more readable * we should also rename the variable "sessionPersistence" (same as above) * in setWebContextObjects instead of: {code} if (!persistSerialized) { session.setAttribute("delegator", null); } else { session.setAttribute("delegator", delegator); } {code} it will be more readable as: {code} if (persistSerialized) { session.setAttribute("delegator", delegator); } else { session.setAttribute("delegator", null); } {code} or, if you will implement my suggestion #1: {code} if (distributableApplication) { session.setAttribute("delegator", null); } else { session.setAttribute("delegator", delegator); } {code} * in order to increase readability we could group all the special code for distributable application in the same block: {code} if (distributableApplication) { session.setAttribute("delegator", null); session.setAttribute("dispatcher", null); session.setAttribute("security", null); session.setAttribute("authz", null); } else { session.setAttribute("delegator", delegator); session.setAttribute("dispatcher", dispatcher); session.setAttribute("security", security); session.setAttribute("authz", authz); } {code}; this is actually minor; however see my next 2 comments * did you consider to not change the code here but instead, before the session is serialized, remove all the objects that are not "instanceof Serializable"? * what is the effect (in distributable appls) of setting nulls for security/dispatcher/delegator etc...? isn't it causing any issue? aren't they used? > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400122#comment-13400122 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- Also Config.getContainerConfig() really does not need to be synchronized, there are no worries: # staticContainerConfig is set once when Config.getInstance() in Start.init() and will then never change # Config.getContainerConfig() can't be called from LoginWorker.doBasicLogout() before OFBIz is up, so it should never be empty, and even in this case it will be handled (persistence will be used). Of course it should not be called before OFBIz is up, does not make sense to do so anyway. # staticContainerConfig is only an always read So if we agree on committint this, I will remove synchronized from Config.getContainerConfig(), it's useless > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400124#comment-13400124 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- Ha we crosses on wire... # I agree on the name # instanceof Serializable: I did not consider it. Maybe it's better to let developper catch them and decide about it. In OFBiz we are not used to serialise all classes... # I did not find any issues doing this. But I must say the application which was using this in production (during 1 month, before, for other reasons, I decided to turn to round-robin LB and sticky sessions) is really a pure eCommerce application. Only Webtools and totally new and specific backend applications are used else. > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400125#comment-13400125 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ Jacques, I didn't note the synchronized statement; yes please remove it because it is the wrong way to make it thread safe; however I disagree that the variable is immutable; it would be immutable if set in a static initializer and marked as final, which is not the case here. However it is not the only example non thread safe fields in that class and the way the class is *currently* used is fine, so this is a minor issue; however it is not really a good pattern to define a static variable that should only be used after an object of that class is created (it is like of an implicit singleton). > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400124#comment-13400124 ] Jacques Le Roux edited comment on OFBIZ-4289 at 6/24/12 10:23 AM: ------------------------------------------------------------------ == TYPO == Ha we crossed on wire... # I agree on the name # instanceof Serializable: I did not consider it. Maybe it's better to let developper catch them and decide about it. In OFBiz we are not used to serialise all classes... # I did not find any issues doing this. But I must say the application which was using this in production (during 1 month, before, for other reasons, I decided to turn to round-robin LB and sticky sessions) is really a pure eCommerce application. Only Webtools and totally new and specific backend applications are used else. was (Author: jacques.le.roux): Ha we crosses on wire... # I agree on the name # instanceof Serializable: I did not consider it. Maybe it's better to let developper catch them and decide about it. In OFBiz we are not used to serialise all classes... # I did not find any issues doing this. But I must say the application which was using this in production (during 1 month, before, for other reasons, I decided to turn to round-robin LB and sticky sessions) is really a pure eCommerce application. Only Webtools and totally new and specific backend applications are used else. > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400126#comment-13400126 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ The synchronized accessor can be removed because it doesn't make sense to synchronized the getter if you do not synchronize also the code that change the value of the variable. > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400127#comment-13400127 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- I suppose the way this class is used should not change. But yes I agree we could do better there... > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400128#comment-13400128 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ Jacques about your point: {quote}3. I did not find any issues doing this. But I must say the application which was using this in production (during 1 month, before, for other reasons, I decided to turn to round-robin LB and sticky sessions) is really a pure eCommerce application. Only Webtools and totally new and specific backend applications are used else.{quote} I suspect that you simply didn't test the proper code, unless these session objects are completely unused (I didn't check but I suspect they are actually used). We should better check how they are used and when before setting them to null. It is like repairing a broken engine by pulling out broken parts without replacing them... if *everything* works fine then there was no reason for keeping them in even if they were not broken. > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400130#comment-13400130 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ Jacques, about your comment: {quote}instanceof Serializable: I did not consider it. Maybe it's better to let developper catch them and decide about it. In OFBiz we are not used to serialise all classes...{quote} I was not suggesting to add Serializable to OFBiz classes; I was saying that, if the issue you are facing in distributable app mode is that the session contains non serializable objects (e.g. "security" etc..) then, instead of hardcoding the code in LoginWorker to null them, it would be more elegant (impossible) to hook before the session is serialized and iterate thru the objects in the session and null the ones that don't implement Serializable. In this way, if the system is running a serializable Security implementation, then it will be stored in the session even if in distributable mode. The code would be also cleaner (no need to add variables and special handling in LoginWorker) > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400132#comment-13400132 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- I did not get what you mean by {quote} if everything works fine then there was no reason for keeping them in even if they were not broken. {quote} What I know is that if you try to serialize them you get a NPE (from Tomcat) because they can't be serialised. In other words it works in a non distributed context but, as soon as you want to distribute, login out fails, because you need to persist sessions. On the other hands, I agree on this {quote} We should better check how they are used and when before setting them to null. {quote} But what will you do then: make them serializable? Or maybe rather change the code which is *supposed* to use them... {quote} was not suggesting to add Serializable to OFBiz classes; {quote} I did not understand that. I was simply suggesting that developers may add other Objects in session (than the ones we are concerned so far) that would be non serialised, ignoring the issue with logout in distributed applications. But they may want and be able to serialise them. With what you are suggesting this will be hidden and will not let them cope with the issue they may ignore (this is not an obvious issue before you stumble upon it, believe me). For instance (I hope) nobody was aware of this issue before I found it. {quote} I was saying that, if the issue you are facing in distributable app mode is that the session contains non serializable objects (e.g. "security" etc..) then, instead of hardcoding the code in LoginWorker to null them, it would be more elegant (impossible) to hook before the session is serialized and iterate thru the objects in the session and null the ones that don't implement Serializable. In this way, if the system is running a serializable Security implementation, then it will be stored in the session even if in distributable mode. The code would be also cleaner (no need to add variables and special handling in LoginWorker) {quote} This is going much further than expected. First we must know why those are put in session, what is the need? {quote} hook before the session is serialized {quote} This is done by Tomcat (actually the implementation of [ManagerBase|http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/session/ManagerBase.html] used) and, if possible, I guess would need much more work than clarifying the fact that those are really needed in session when login out... > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400136#comment-13400136 ] Jacques Le Roux commented on OFBIZ-4289: ---------------------------------------- To keep is short, I think there is no reasons to dicuss this any longer as long as we don't clarify the need/s on those 4 Objects in session at logout. Also of course developers who want to distribute their application should either remove non serialised Objects from session or serialise them. > 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, changeset_2510.diff > > > 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 |
|
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400137#comment-13400137 ] Jacopo Cappellato commented on OFBIZ-4289: ------------------------------------------ Jacques, in short I don't think it is a proper fix to set them to null just to avoid the error during serialization, unless you also provide a mechanism to reinsert them when the session is deserialized OR refactor the code to not require non serializable objects in the session OR refactor code to make them serializable. I mean, we have to fix the root cause of the issue and not just the effects. > 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, changeset_2510.diff > > > 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 |
| Free forum by Nabble | Edit this page |
