cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helma van der Linden (JIRA)" <j...@apache.org>
Subject [jira] Closed: (COCOON-793) Scope "leaks" using multiple sessions using new flow framework
Date Tue, 25 Oct 2005 14:02:56 GMT
     [ http://issues.apache.org/jira/browse/COCOON-793?page=all ]
     
Helma van der Linden closed COCOON-793:
---------------------------------------

    Resolution: Fixed

> Scope "leaks" using multiple sessions using new flow framework
> --------------------------------------------------------------
>
>          Key: COCOON-793
>          URL: http://issues.apache.org/jira/browse/COCOON-793
>      Project: Cocoon
>         Type: Bug
>   Components: * Cocoon Core
>     Versions: 2.1
>  Environment: Operating System: Windows XP
> Platform: PC
>     Reporter: Gunnar Brand
>     Assignee: Cocoon Developers Team
>  Attachments: fom_flow_bug.zip
>
> Using the new flow framework I encountered numerous null pointer exceptions 
> using the cocoon object's getComponent. This only 
> happened if more than _one_ session accessed the application.
> After adding a lot of debug messages to the FOM_* classes I noticed that the 
> FOM_Cocoon instance changed in the flow script. 
> After 2 days of tracing I finally found what causes the problem:
> I am using javascript objects in my application and somehow the scope changes 
> to the scope created by the latest session. This 
> scope then is used in _all_ sessions. Obviously all but the last sessions fail, 
> because the FOM_Cocoon object is invalidated 
> when it is not used, i.e. all internal references are null.
> (When I overloaded the get method in FOM_JavaScriptInterpreter.ThreadScope and 
> added a debug message, I could see that the 2nd 
> argument (the threadScope instance) suddenly changes. I suspect that the top 
> level scope is somehow used for all sessions.)
> You can reproduce the problem with the attached simple test script.
> It displays the global "application" and "cocoon" object's hashcodes.
> One time called from the global function test() and the other time from inside 
> the application object.
> If you have two or more browser windows open, the first will display something 
> like this:
> global 
> stats(): application.hash = 2829043
>          application      = 2829043
>          cocoon           = 22342265
> application 
> Application.stats(): this.hash   = 2829043
>                      this.cocoon = 22342265 --> calling stats():
> stats(): application.hash = 2829043
>          application      = 2829043
>          cocoon           = 22342265
> -------------------------------------------------------------------
> And if you load the same application in the second window:
> global 
> stats(): application.hash = 9089012
>          application      = 9089012
>          cocoon           = 19257644
> application 
> Application.stats(): this.hash   = 9089012
>                      this.cocoon = 19257644 --> calling stats():
> stats(): application.hash = 9089012
>          application      = 9089012
>          cocoon           = 19257644
> --------------------------------------------------------------------
> Once you press continue in the first window you get the unexpected result:
> global 
> stats(): application.hash = 2829043
>          application      = 2829043
>          cocoon           = 22342265
> application 
> Application.stats(): this.hash   = 2829043
>                      this.cocoon = 22342265 --> calling stats():
> stats(): application.hash = 9089012
>          application      = 9089012
>          cocoon           = 19257644
> As you can see the scope changes and stays this way for every called function 
> or method. It doesn't matter if I call stats() 
> from Application.stats() or output the values directly, both report the wrong 
> ones (inside the Application object this!=
> application and cocoon is invalid).
> Obviously this error does not occur until one is using javascript objects in 
> the flow scripts.
> I don't know if that is the same reason for the npes I had with the old flow 
> engine now and then.
> I am using Cocoon 2.1 and JDK 1.4.1_03.
> Gunnar

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message