You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2019/11/21 15:37:03 UTC
Re: Application # newSession # sessionUnbound - RuntimeException
Hi Francois,
#sessionUnbound() is called in two contexts:
1) the user clicked the Logout button - in this case the call is executed
in http worker thread where there is a ThreadContext, i.e.
Application.get(), Session.get() and RequestCycle.get() would work
here, I think, Wicket should use the ExceptionMapper
2) when the user session has timed out - in this case the web container
(Tomcat/Jetty) will execute this method in non-worker thread and
Application.get() would be null, so we cannot get a reference to the
ExceptionMapper
On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <fr...@gmail.com>
wrote:
> Hi,
>
> Any RuntimeException thrown in Application # newSession(Request request,
> Response response) is handled by the DefaultExceptionMapper #
> mapUnexpectedExceptions(Exception e, final Application application)
>
> but
>
> Any RuntimeException thrown in Application # sessionUnbound(String
> sessionid) is not handled
>
> Is that normal ?
>
> François
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Francois Meillet <fr...@gmail.com>.
thanks Martin
François
> Le 21 nov. 2019 à 16:37, Martin Grigorov <mg...@apache.org> a écrit :
>
> Hi Francois,
>
> #sessionUnbound() is called in two contexts:
> 1) the user clicked the Logout button - in this case the call is executed
> in http worker thread where there is a ThreadContext, i.e.
> Application.get(), Session.get() and RequestCycle.get() would work
> here, I think, Wicket should use the ExceptionMapper
> 2) when the user session has timed out - in this case the web container
> (Tomcat/Jetty) will execute this method in non-worker thread and
> Application.get() would be null, so we cannot get a reference to the
> ExceptionMapper
>
> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <fr...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Any RuntimeException thrown in Application # newSession(Request request,
>> Response response) is handled by the DefaultExceptionMapper #
>> mapUnexpectedExceptions(Exception e, final Application application)
>>
>> but
>>
>> Any RuntimeException thrown in Application # sessionUnbound(String
>> sessionid) is not handled
>>
>> Is that normal ?
>>
>> François
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Sven Meier <sv...@meiers.net>.
Hi Francois,
yes, that's a non-request thread.
IExceptionMapper isn't a general exception handler, it is a mapper from
exceptions to request handlers.
Using it here does not make sense.
Have fun
Sven
On 21.11.19 18:12, Francois Meillet wrote:
> WARNING [Catalina-utility-1] org.apache.catalina.core.StandardContext.backgroundProcess Exception lors du traitement d'arrière plan du gestionnaire de sessions [StandardManager[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]]
> java.lang.RuntimeException
> at baz.web.base.app.OfferApplication.sessionUnbound(OfferApplication.java:560)
> at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:444)
> at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1784)
> at org.apache.catalina.session.StandardSession.expire(StandardSession.java:856)
> at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:659)
> at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:573)
> at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:558)
> at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5539)
> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1353)
> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
> at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1335)
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
> at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>
> François
>
>
>
>> Le 21 nov. 2019 à 17:55, Sven Meier <sv...@meiers.net> a écrit :
>>
>> Yes, I mean a non-web-request thread, i.e. when the session expires as you've written.
>>
>> Sven
>>
>> On 21.11.19 17:52, Martin Grigorov wrote:
>>> On Thu, Nov 21, 2019 at 6:30 PM Sven Meier <sv...@meiers.net> wrote:
>>>
>>>> Hi,
>>>>
>>>> actually #sessionUnbound() is called *on* the application instance, so
>>>> the ExceptionMapper is available.
>>>>
>>> oh, right. silly me!
>>>
>>>
>>>
>>>> But ExceptionMapper maps an exception to a requestHandler, this doesn't
>>>> make sense for an exception happening on a worker thread.
>>>>
>>> you meant on *non*-worker thread ?
>>>
>>> Francois, please give us the stack trace.
>>>
>>>
>>>> Hope this helps
>>>> Sven
>>>>
>>>>
>>>> On 21.11.19 16:37, Martin Grigorov wrote:
>>>>> Hi Francois,
>>>>>
>>>>> #sessionUnbound() is called in two contexts:
>>>>> 1) the user clicked the Logout button - in this case the call is executed
>>>>> in http worker thread where there is a ThreadContext, i.e.
>>>>> Application.get(), Session.get() and RequestCycle.get() would work
>>>>> here, I think, Wicket should use the ExceptionMapper
>>>>> 2) when the user session has timed out - in this case the web container
>>>>> (Tomcat/Jetty) will execute this method in non-worker thread and
>>>>> Application.get() would be null, so we cannot get a reference to the
>>>>> ExceptionMapper
>>>>>
>>>>> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <
>>>> francois.meillet@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Any RuntimeException thrown in Application # newSession(Request request,
>>>>>> Response response) is handled by the DefaultExceptionMapper #
>>>>>> mapUnexpectedExceptions(Exception e, final Application application)
>>>>>>
>>>>>> but
>>>>>>
>>>>>> Any RuntimeException thrown in Application # sessionUnbound(String
>>>>>> sessionid) is not handled
>>>>>>
>>>>>> Is that normal ?
>>>>>>
>>>>>> François
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Francois Meillet <fr...@gmail.com>.
WARNING [Catalina-utility-1] org.apache.catalina.core.StandardContext.backgroundProcess Exception lors du traitement d'arrière plan du gestionnaire de sessions [StandardManager[StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]]
java.lang.RuntimeException
at baz.web.base.app.OfferApplication.sessionUnbound(OfferApplication.java:560)
at org.apache.wicket.session.HttpSessionStore$SessionBindingListener.valueUnbound(HttpSessionStore.java:444)
at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1784)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:856)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:659)
at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:573)
at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:558)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5539)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1353)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1357)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1335)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
François
> Le 21 nov. 2019 à 17:55, Sven Meier <sv...@meiers.net> a écrit :
>
> Yes, I mean a non-web-request thread, i.e. when the session expires as you've written.
>
> Sven
>
> On 21.11.19 17:52, Martin Grigorov wrote:
>> On Thu, Nov 21, 2019 at 6:30 PM Sven Meier <sv...@meiers.net> wrote:
>>
>>> Hi,
>>>
>>> actually #sessionUnbound() is called *on* the application instance, so
>>> the ExceptionMapper is available.
>>>
>> oh, right. silly me!
>>
>>
>>
>>> But ExceptionMapper maps an exception to a requestHandler, this doesn't
>>> make sense for an exception happening on a worker thread.
>>>
>> you meant on *non*-worker thread ?
>>
>> Francois, please give us the stack trace.
>>
>>
>>> Hope this helps
>>> Sven
>>>
>>>
>>> On 21.11.19 16:37, Martin Grigorov wrote:
>>>> Hi Francois,
>>>>
>>>> #sessionUnbound() is called in two contexts:
>>>> 1) the user clicked the Logout button - in this case the call is executed
>>>> in http worker thread where there is a ThreadContext, i.e.
>>>> Application.get(), Session.get() and RequestCycle.get() would work
>>>> here, I think, Wicket should use the ExceptionMapper
>>>> 2) when the user session has timed out - in this case the web container
>>>> (Tomcat/Jetty) will execute this method in non-worker thread and
>>>> Application.get() would be null, so we cannot get a reference to the
>>>> ExceptionMapper
>>>>
>>>> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <
>>> francois.meillet@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Any RuntimeException thrown in Application # newSession(Request request,
>>>>> Response response) is handled by the DefaultExceptionMapper #
>>>>> mapUnexpectedExceptions(Exception e, final Application application)
>>>>>
>>>>> but
>>>>>
>>>>> Any RuntimeException thrown in Application # sessionUnbound(String
>>>>> sessionid) is not handled
>>>>>
>>>>> Is that normal ?
>>>>>
>>>>> François
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Sven Meier <sv...@meiers.net>.
Yes, I mean a non-web-request thread, i.e. when the session expires as
you've written.
Sven
On 21.11.19 17:52, Martin Grigorov wrote:
> On Thu, Nov 21, 2019 at 6:30 PM Sven Meier <sv...@meiers.net> wrote:
>
>> Hi,
>>
>> actually #sessionUnbound() is called *on* the application instance, so
>> the ExceptionMapper is available.
>>
> oh, right. silly me!
>
>
>
>> But ExceptionMapper maps an exception to a requestHandler, this doesn't
>> make sense for an exception happening on a worker thread.
>>
> you meant on *non*-worker thread ?
>
> Francois, please give us the stack trace.
>
>
>> Hope this helps
>> Sven
>>
>>
>> On 21.11.19 16:37, Martin Grigorov wrote:
>>> Hi Francois,
>>>
>>> #sessionUnbound() is called in two contexts:
>>> 1) the user clicked the Logout button - in this case the call is executed
>>> in http worker thread where there is a ThreadContext, i.e.
>>> Application.get(), Session.get() and RequestCycle.get() would work
>>> here, I think, Wicket should use the ExceptionMapper
>>> 2) when the user session has timed out - in this case the web container
>>> (Tomcat/Jetty) will execute this method in non-worker thread and
>>> Application.get() would be null, so we cannot get a reference to the
>>> ExceptionMapper
>>>
>>> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <
>> francois.meillet@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Any RuntimeException thrown in Application # newSession(Request request,
>>>> Response response) is handled by the DefaultExceptionMapper #
>>>> mapUnexpectedExceptions(Exception e, final Application application)
>>>>
>>>> but
>>>>
>>>> Any RuntimeException thrown in Application # sessionUnbound(String
>>>> sessionid) is not handled
>>>>
>>>> Is that normal ?
>>>>
>>>> François
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Nov 21, 2019 at 6:30 PM Sven Meier <sv...@meiers.net> wrote:
> Hi,
>
> actually #sessionUnbound() is called *on* the application instance, so
> the ExceptionMapper is available.
>
oh, right. silly me!
> But ExceptionMapper maps an exception to a requestHandler, this doesn't
> make sense for an exception happening on a worker thread.
>
you meant on *non*-worker thread ?
Francois, please give us the stack trace.
> Hope this helps
> Sven
>
>
> On 21.11.19 16:37, Martin Grigorov wrote:
> > Hi Francois,
> >
> > #sessionUnbound() is called in two contexts:
> > 1) the user clicked the Logout button - in this case the call is executed
> > in http worker thread where there is a ThreadContext, i.e.
> > Application.get(), Session.get() and RequestCycle.get() would work
> > here, I think, Wicket should use the ExceptionMapper
> > 2) when the user session has timed out - in this case the web container
> > (Tomcat/Jetty) will execute this method in non-worker thread and
> > Application.get() would be null, so we cannot get a reference to the
> > ExceptionMapper
> >
> > On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <
> francois.meillet@gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> Any RuntimeException thrown in Application # newSession(Request request,
> >> Response response) is handled by the DefaultExceptionMapper #
> >> mapUnexpectedExceptions(Exception e, final Application application)
> >>
> >> but
> >>
> >> Any RuntimeException thrown in Application # sessionUnbound(String
> >> sessionid) is not handled
> >>
> >> Is that normal ?
> >>
> >> François
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Application # newSession # sessionUnbound - RuntimeException
Posted by Sven Meier <sv...@meiers.net>.
Hi,
actually #sessionUnbound() is called *on* the application instance, so
the ExceptionMapper is available.
But ExceptionMapper maps an exception to a requestHandler, this doesn't
make sense for an exception happening on a worker thread.
Hope this helps
Sven
On 21.11.19 16:37, Martin Grigorov wrote:
> Hi Francois,
>
> #sessionUnbound() is called in two contexts:
> 1) the user clicked the Logout button - in this case the call is executed
> in http worker thread where there is a ThreadContext, i.e.
> Application.get(), Session.get() and RequestCycle.get() would work
> here, I think, Wicket should use the ExceptionMapper
> 2) when the user session has timed out - in this case the web container
> (Tomcat/Jetty) will execute this method in non-worker thread and
> Application.get() would be null, so we cannot get a reference to the
> ExceptionMapper
>
> On Thu, Nov 21, 2019 at 5:01 PM Francois Meillet <fr...@gmail.com>
> wrote:
>
>> Hi,
>>
>> Any RuntimeException thrown in Application # newSession(Request request,
>> Response response) is handled by the DefaultExceptionMapper #
>> mapUnexpectedExceptions(Exception e, final Application application)
>>
>> but
>>
>> Any RuntimeException thrown in Application # sessionUnbound(String
>> sessionid) is not handled
>>
>> Is that normal ?
>>
>> François
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org