You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Grzegorz Kossakowski (aka g[R]eK) (JIRA)" <ji...@apache.org> on 2007/02/09 13:11:06 UTC

[jira] Created: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

servletContext of BlockPathModule persists between seperate requests
--------------------------------------------------------------------

                 Key: COCOON-2008
                 URL: https://issues.apache.org/jira/browse/COCOON-2008
             Project: Cocoon
          Issue Type: Bug
          Components: - Blocks Framework
    Affects Versions: 2.2-dev (Current SVN)
            Reporter: Grzegorz Kossakowski (aka g[R]eK)
             Fix For: 2.2-dev (Current SVN)


The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.

It seems that this line:
this.servletContext = CallStackHelper.getBaseServletContext();
is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).

I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

Posted by "Grzegorz Kossakowski (aka g[R]eK) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski (aka g[R]eK) updated COCOON-2008:
------------------------------------------------------

    Attachment: COCOON-2008.txt

I attach the patch that shows bugged behavior. Apply it to cocoon-servlet-service-sample and hit:
1. http://localhost:8888/blocks-test/cocoon-servlet-service-sample1/sub/abs
you'll get /cocoon-servlet-service-sample1/test as @abs attribute (correct)
2. Then access http://localhost:8888/blocks-test/cocoon-servlet-service-sample2/sub/abs
and should get the same value as in previous point which is not correct.

> servletContext of BlockPathModule persists between seperate requests
> --------------------------------------------------------------------
>
>                 Key: COCOON-2008
>                 URL: https://issues.apache.org/jira/browse/COCOON-2008
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Blocks Framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Grzegorz Kossakowski (aka g[R]eK)
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: COCOON-2008.txt
>
>
> The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.
> It seems that this line:
> this.servletContext = CallStackHelper.getBaseServletContext();
> is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).
> I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

Posted by "Daniel Fagerstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12472910 ] 

Daniel Fagerstrom commented on COCOON-2008:
-------------------------------------------

I added some faulty code while testing call stack scoped beans. My intention was to use a scope proxied servlet context from the setServletContext if such a property was present in the configuration and otherwise get the current call stack frame. But instead I just got the current call stack frame the first time the getAttribute and used that value to set the property. So in the sequel the same value was used.

This problem could be fixed by using prototype scope as you suggested. But it seemed better to continue to have singleton scope and fix the faulty logic. So I did that.

Please check that it works in your context.

> servletContext of BlockPathModule persists between seperate requests
> --------------------------------------------------------------------
>
>                 Key: COCOON-2008
>                 URL: https://issues.apache.org/jira/browse/COCOON-2008
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Blocks Framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Grzegorz Kossakowski (aka g[R]eK)
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: COCOON-2008-prototype-scope.txt, COCOON-2008.txt
>
>
> The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.
> It seems that this line:
> this.servletContext = CallStackHelper.getBaseServletContext();
> is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).
> I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

Posted by "Grzegorz Kossakowski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COCOON-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474047 ] 

Grzegorz Kossakowski commented on COCOON-2008:
----------------------------------------------

I've tested your changes with refactored Forms (they use block-path module quite heavily) and everything works fine.

Thanks. Close this issue, please.

> servletContext of BlockPathModule persists between seperate requests
> --------------------------------------------------------------------
>
>                 Key: COCOON-2008
>                 URL: https://issues.apache.org/jira/browse/COCOON-2008
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Blocks Framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Grzegorz Kossakowski
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: COCOON-2008-prototype-scope.txt, COCOON-2008.txt
>
>
> The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.
> It seems that this line:
> this.servletContext = CallStackHelper.getBaseServletContext();
> is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).
> I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

Posted by "Daniel Fagerstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Fagerstrom closed COCOON-2008.
-------------------------------------

    Resolution: Fixed

> servletContext of BlockPathModule persists between seperate requests
> --------------------------------------------------------------------
>
>                 Key: COCOON-2008
>                 URL: https://issues.apache.org/jira/browse/COCOON-2008
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Blocks Framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Grzegorz Kossakowski
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: COCOON-2008-prototype-scope.txt, COCOON-2008.txt
>
>
> The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.
> It seems that this line:
> this.servletContext = CallStackHelper.getBaseServletContext();
> is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).
> I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COCOON-2008) servletContext of BlockPathModule persists between seperate requests

Posted by "Grzegorz Kossakowski (aka g[R]eK) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COCOON-2008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Grzegorz Kossakowski (aka g[R]eK) updated COCOON-2008:
------------------------------------------------------

    Attachment: COCOON-2008-prototype-scope.txt

COCOON-2008-prototype-scope.txt:
Scope attribute should be set to 'prototype' to get input modules (block-path and block-property) working properly. Attached patch fixes that.

> servletContext of BlockPathModule persists between seperate requests
> --------------------------------------------------------------------
>
>                 Key: COCOON-2008
>                 URL: https://issues.apache.org/jira/browse/COCOON-2008
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Blocks Framework
>    Affects Versions: 2.2-dev (Current SVN)
>            Reporter: Grzegorz Kossakowski (aka g[R]eK)
>             Fix For: 2.2-dev (Current SVN)
>
>         Attachments: COCOON-2008-prototype-scope.txt, COCOON-2008.txt
>
>
> The same servlet context is being reused between _separate_ requests leading to returning invalid absolute uri's.
> It seems that this line:
> this.servletContext = CallStackHelper.getBaseServletContext();
> is being called only once, when BlockPathModule is used first time, and then servletContext is never null (holds old value).
> I'm not sure, but it seems that life cycle of this class is not set up correctly. Even though I'm going to figure it out, it would be great if someone with better Spring/Cocoon internals knowledge could take a look on this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.