You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Michael Sparer (JIRA)" <ji...@apache.org> on 2008/04/04 09:47:24 UTC

[jira] Created: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
------------------------------------------------------------------------------

                 Key: WICKET-1478
                 URL: https://issues.apache.org/jira/browse/WICKET-1478
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.2
            Reporter: Michael Sparer
            Priority: Minor
         Attachments: quickstart404.jar

Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.

See attached quickstart for the complete stacktrace (and my usecase)
See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Commented: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12587645#action_12587645 ] 

Johan Compagner commented on WICKET-1478:
-----------------------------------------

Also the discussion there is about session leakage and so on on the mailing list
i also did get some mails where people where checking Application/Session/RequestCycle and RequestContext
if they where still there at points (complete beginning of a request)
And they told me that RequestContext was still there quite a lot.. So that seems wrong somehow i am also investigation that some more
But if you could check for places where the RequestContext is not cleared (and application and session are) ...



> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Ate Douma
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Assigned: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Johan Compagner reassigned WICKET-1478:
---------------------------------------

    Assignee: Ate Douma  (was: Johan Compagner)

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Ate Douma
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Updated: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Michael Sparer updated WICKET-1478:
-----------------------------------

    Attachment: quickstart404.jar

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Priority: Minor
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Closed: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Johan Compagner closed WICKET-1478.
-----------------------------------

    Resolution: Fixed

i am closing this one, should be fixed

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.3.5
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Assigned: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Ate Douma reassigned WICKET-1478:
---------------------------------

    Assignee: Johan Compagner  (was: Ate Douma)

Johan,

I don't have time to evaluate this right now: this is something too tricky to be able to review by looking at the code itself. I need to test this out in the portal to be sure what happens.
What I'm curious about though is: why do you "reset" the Application to previous? Why can't you just clear it properly (e.g. setting the threadlocals really to null) instead?

I'm willing to test this out and see how it works when running as a portlet, but it'll have to wait until after the ApacheCon (so next week the earliest).
For now, you're changes should be fine for plain webapps as the default non-portlet RequestContext instance doesn't keep any state anyway (the PortletRequestContext does however).

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Updated: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Johan Compagner updated WICKET-1478:
------------------------------------

    Assignee: Ate Douma  (was: Johan Compagner)

OK, when setting an error status (httpServletResponse.sendError(errorCode)), the container will try to resolve that in that call itself. This will result in a second wicket call in the same thread. Because of that we will clean all thread locals like RequestCycle and Application. I do reset those now to the previous values.

The problem is that we have more thread locals which also could be affected. Like Sessions thread locals (dirty pages) Also the RequestContext for our portlet support how to handle that?
We need to look at this in a next release a bit more (1.4)

So for the most part this is fixed (if not everything) for the next 1.3.x release.

Ate: can you quickly look at this code in WicketFilter:
				// unset the application thread local if it didn't exist already.
				if (previous == null)
				{
					Application.unset();
					RequestContext.unset();
				}
				else
				{
					Application.set(previous);
				}
You see i dont do anything with RequestContext when the previous app was there..
Can i do that? Or is this not an issue at all in portlets?

Reassign to me when you have looked at it.

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Ate Douma
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Commented: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-1478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586147#action_12586147 ] 

Johan Compagner commented on WICKET-1478:
-----------------------------------------

We did clean it up, but the problem is that it is already set for the first request
As i said doing this:

httpServletResponse.sendError(errorCode)

will result in a redispatch of that code immediately so inside that call this is sort of the stacktrace:

wicketfilter.doget() 
wicketfilter.dofilter() -> does the second request
jettycode
httpServletResponse.sendError(errorCode)
WebErrorResponseRequestTarget.response()
wicketfilter.doget()
wicketfilter.dofilter()  -> does the first request

so you see if we would cleanup ALL the thread locals in the second request wicketfilter.
We have a problem when the  WebErrorResponseRequestTarget.response() comes back
Because everything is cleared, The Application is gone the RequestCycle is gone.
So everything that comes after that (detach and so on) will bomb out because there are no more threadlocals.




> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Assigned: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Igor Vaynberg reassigned WICKET-1478:
-------------------------------------

    Assignee: Johan Compagner  (was: Ate Douma)

where are we with this johan?

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.3.5
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Updated: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Johan Compagner updated WICKET-1478:
------------------------------------

    Fix Version/s: 1.3.4
         Assignee: Johan Compagner

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Johan Compagner
>            Priority: Minor
>             Fix For: 1.3.4
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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


[jira] Updated: (WICKET-1478) AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException

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

Martijn Dashorst updated WICKET-1478:
-------------------------------------

    Fix Version/s:     (was: 1.3.4)
                   1.3.5

> AbortWithWebErrorCodeException in onBeforeRender causes WicketRuntimeException
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-1478
>                 URL: https://issues.apache.org/jira/browse/WICKET-1478
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.2
>            Reporter: Michael Sparer
>            Assignee: Ate Douma
>            Priority: Minor
>             Fix For: 1.3.5
>
>         Attachments: quickstart404.jar
>
>
> Using custom error pages as described on http://cwiki.apache.org/WICKET/error-pages-and-feedback-messages.html, a wicket RTE gets thrown "There is no application attached to current thread [threadname]" when a AbortWithWebErrorCodeException is thrown in the onBeforeRender method of a WebPage. Note that this _only_ happens when using a custom error page defined in web.xml.
> See attached quickstart for the complete stacktrace (and my usecase)
> See also the mailinglist entry on http://www.nabble.com/Throw-AbortWithWebErrorCodeException-in-onBeforeRender-to16446341.html#a16473849

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