You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2010/11/13 21:15:13 UTC

[jira] Issue Comment Edited: (WICKET-3168) No Application in the thread when the web server destroys WicketFilter

    [ https://issues.apache.org/jira/browse/WICKET-3168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12931724#action_12931724 ] 

Martin Grigorov edited comment on WICKET-3168 at 11/13/10 3:14 PM:
-------------------------------------------------------------------

Yes and No.
Yes - GAE runs on Jetty. I guess older than the fixed one.
No - currently WicketFilter#destroy() stack trace has no Application in the thread local, in WICKET-3011 org.apache.wicket.session.HttpSessionStore.SessionBindingListener.valueUnbound(HttpSessionBindingEvent) (i.e. Application#sessionUnbound()) will have no Application.get().
Only Application.get(String) will work because HttpSessionStore has 'applicationKey' member.

In this ticket even Application.get(String) is not available for :

	getPageManager().destroy();
	getSessionStore().destroy();

in Application#internalDestroy() because 

		applicationKeyToApplication.remove(getApplicationKey());

is called before them.
I think we should move that line at the bottom of #internalDestroy() too.

      was (Author: mgrigorov):
    Yes and No.
Yes - GAE runs on Jetty. I guess older than the fixed one.
No - currently WicketFilter#destroy() stack trace has no Application in the thread local, in WICKET-3011 org.apache.wicket.session.HttpSessionStore.SessionBindingListener.valueUnbound(HttpSessionBindingEvent) (i.e. Application#sessionUnbound()) will have no Application.get().
Only Application.get(String) will work because HttpSessionStore has 'applicationKey' member.

I this ticket even Application.get(String) is not available for :

	getPageManager().destroy();
	getSessionStore().destroy();

in Application#internalDestroy() because 

		applicationKeyToApplication.remove(getApplicationKey());

is called before them.
I think we should move that line at the bottom of #internalDestroy() too.
  
> No Application in the thread when the web server destroys WicketFilter
> ----------------------------------------------------------------------
>
>                 Key: WICKET-3168
>                 URL: https://issues.apache.org/jira/browse/WICKET-3168
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5-M3
>            Reporter: Martin Grigorov
>
> Playing with Wicket 1.5 + Google AppEngine I saw this exception after modifying appengine-web.xml:
> WARNING: EXCEPTION 
> org.apache.wicket.WicketRuntimeException: There is no application attached to current thread Timer-2
> 	at org.apache.wicket.Application.get(Application.java:250)
> 	at org.apache.wicket.Session.get(Session.java:154)
> 	at org.apache.wicket.page.DefaultPageManagerContext.getSessionAttribute(DefaultPageManagerContext.java:63)
> 	at org.apache.wicket.pageStore.memory.HttpSessionDataStore.getPageTable(HttpSessionDataStore.java:130)
> 	at org.apache.wicket.pageStore.memory.HttpSessionDataStore.destroy(HttpSessionDataStore.java:116)
> 	at org.apache.wicket.pageStore.DefaultPageStore.destroy(DefaultPageStore.java:66)
> 	at org.apache.wicket.page.PersistentPageManager.destroy(PersistentPageManager.java:374)
> 	at org.apache.wicket.page.PageManagerDecorator.destroy(PageManagerDecorator.java:86)
> 	at org.apache.wicket.Application.internalDestroy(Application.java:839)
> 	at org.apache.wicket.protocol.http.WebApplication.internalDestroy(WebApplication.java:440)
> 	at org.apache.wicket.protocol.http.WicketFilter.destroy(WicketFilter.java:437)
> 	at org.mortbay.jetty.servlet.FilterHolder.destroyInstance(FilterHolder.java:127)
> 	....
> I.e. the asynchronous thread that destroys WicketFilter has no ThreadContext thread local and thus this exception.
> I see two problems/solutions:
> 1) HttpSessionDataStore should have noop #destroy() - the Application is being destroyed, so all its http sessions will be deleted and there is no need to clean the special attribute which stores session's pages
> 2) WicketFilter#destroy() can set/unset the application in ThreadContext, so other functionality in all #destroy() methods will have access to the Application via Application.get()
> Any objections ?

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