[ 
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

Jacopo,

A) Right, I will use <<Debug.logError(e, module);>> rather. Note that I don't 
know yet how this will work when out of the Tomcat context for distributed 
application. Because, at least for now, I have no means to know if we are in 
such a context for other application servers. The problem will be the same than 
with current code: those application servers will try to persist the session 
and will stumble upon those not serialised variables and a NPE will be thrown. 
This should be investigated in appserver component, another task...
B) Right, when you suggested to change the name of the distributableApplication 
boolean var (from sessionPersistence) it also reversed its meaning. I forgot 
then to change the initialisation and to remove the negation when assigning it
{code}
Boolean distributableApplication = true;
[...]
distributableApplication = !ContainerConfig.getPropertyValue(cc, 
"apps-distributable", false);
{code}
are now
{code}
Boolean distributableApplication = false;
[...]
distributableApplication = ContainerConfig.getPropertyValue(cc, 
"apps-distributable", false);
{code}
C) This was due to B. With attached patch, the vars are not put in session only 
in distributable mode. So current behaviour will continue, but in case of 
distrib apps we will not cross a NPE.
D) This was due to B, I tested it's OK with attached patch
E) Actually the comment I found 
{code}
// now set the delegator and dispatcher in a bunch of places just in case they 
were changed
{code}
answers to this question. I have been positive and reused this knowledge in 
NOTE2 rather than complaining

I think my last patch answers to all your questions. It works in both cases: 
apps-distributable being true or false

The bright side of this brainstorming is that it's now really easy to test. The 
confusion I intially introduced with DeltaManager no longer exists. And since 
the default Manager (StandardManager) is also able to persist sessions only 
changing the value of apps-distributable to true or false allows to test the 
"feature"

Just curious: why did you not use the Jira automatic numbering (ie #) and used 
instead A), B) etc. ?

Thanks for your continued reviews!
                
> 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, 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

        

Reply via email to