You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jakub Królikowski <ja...@pakamera.com.pl> on 2011/05/01 03:19:33 UTC

"Expire sessions" button in Tomcat Manager

Hello,

I'm using Tomcat 6.0.32. My app is configured in server.xml file like this:

  <Host name="www.myapp.pl" appBase="/usr/lib/tomcat/webapps"
                unpackWARs="false" autoDeploy="false"
              xmlValidation="false" xmlNamespaceAware="false"  >
     <Context docBase="/var/www/myapp" path="" cacheMaxSize="5120"
cacheTTL="60000" cachingAllowed="true" >
     </Context>
     <Context path="/manager"  privileged="true"
docBase="/usr/lib/tomcat/webapps/manager">
     </Context>

</Host>

In Tomcat Manager, on the application list, there is a button "Expire
sessions"  available only for "/manager" application.

How should I configure tomcat to get this button for my application
("/") as well?


Best regards,

Jakub

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: "Expire sessions" button in Tomcat Manager

Posted by Jakub Królikowski <ja...@pakamera.com.pl>.
On Wed, May 4, 2011 at 9:35 PM, Konstantin Kolinko
<kn...@gmail.com> wrote:
> 2011/5/4 Jakub Królikowski <ja...@pakamera.com.pl>:
>> Chris,
>>
>> I checked sources, HTMLManagerServlet.java is the answer.
>> Button "expire" is showing only if application is deployed, it's
>> hidden when app is configured with servlet.xml.
>> Does anybody knows why?
>
> Just a bug. Please file it in Bugzilla.

Ok!

>
> There is no "Undeploy" button in this case, so maybe the expire one
> followed the suit, or maybe just oversight.
>
> Deploying an app by adding it to server.xml is a rare and
> non-recommended use case. Why you cannot put them into
> conf/www.myapp.pl/ROOT.xml
> conf/www.myapp.pl/manager.xml
> respectively ?

Thank you for that hint, you're right, it's better way of configuration.
And with this "expire" button show up!

>
>>
>> Why I want to expire sessions? Well, actually I need it only for
>> performance tests.
>
> The command is still there, if you know what URL to invoke. Though you
> might want to silence the CsrfPreventionFilter -- see its init-param
> named "entryPoints".
>
>> I'm testing application with JMeter, creating a lot
>> of sessions. When I want to stop test and run the next one - sessions
>> from first test are still there. I would like to expire them if
>> they're idle more than 10 minutes.
>
> Maybe you want to change the value for <session-timeout> in your
> web-app's web.xml (or the default one in conf/web.xml)?

No, better not.

>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: "Expire sessions" button in Tomcat Manager

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/5/4 Jakub Królikowski <ja...@pakamera.com.pl>:
> Chris,
>
> I checked sources, HTMLManagerServlet.java is the answer.
> Button "expire" is showing only if application is deployed, it's
> hidden when app is configured with servlet.xml.
> Does anybody knows why?

Just a bug. Please file it in Bugzilla.

There is no "Undeploy" button in this case, so maybe the expire one
followed the suit, or maybe just oversight.

Deploying an app by adding it to server.xml is a rare and
non-recommended use case. Why you cannot put them into
conf/www.myapp.pl/ROOT.xml
conf/www.myapp.pl/manager.xml
respectively ?

>
> Why I want to expire sessions? Well, actually I need it only for
> performance tests.

The command is still there, if you know what URL to invoke. Though you
might want to silence the CsrfPreventionFilter -- see its init-param
named "entryPoints".

> I'm testing application with JMeter, creating a lot
> of sessions. When I want to stop test and run the next one - sessions
> from first test are still there. I would like to expire them if
> they're idle more than 10 minutes.

Maybe you want to change the value for <session-timeout> in your
web-app's web.xml (or the default one in conf/web.xml)?


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: "Expire sessions" button in Tomcat Manager

Posted by Jakub Królikowski <ja...@pakamera.com.pl>.
Chris,

I checked sources, HTMLManagerServlet.java is the answer.
Button "expire" is showing only if application is deployed, it's
hidden when app is configured with servlet.xml.
Does anybody knows why?

Why I want to expire sessions? Well, actually I need it only for
performance tests. I'm testing application with JMeter, creating a lot
of sessions. When I want to stop test and run the next one - sessions
from first test are still there. I would like to expire them if
they're idle more than 10 minutes.

Bests,

Jakub

On Mon, May 2, 2011 at 4:09 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jakub,
>
> On 4/30/2011 9:19 PM, Jakub Królikowski wrote:
>> In Tomcat Manager, on the application list, there is a button "Expire
>> sessions"  available only for "/manager" application.
>>
>> How should I configure tomcat to get this button for my application
>> ("/") as well?
>
> Take a look at the manager webapp's source code. I suspect it uses JMX
> to inspect the session manager and invalidate each session ... or maybe
> the session manager has an "invalidate all sessions" operation you can
> perform.
>
> If you don't feel like reading the source, you can write your own
> HttpSessionListener, register all sessions that get created (remember to
> de-register them when they are invalidated), and then consult that when
> you want to expire all sessions.
>
> Why do you want do expire all sessions at once?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2+uyEACgkQ9CaO5/Lv0PDM2ACgj6YUb8HtH6QhF/lVVpyOaNLK
> Bu0AnR5u9zar07AIZ6FdV2C08qbgbupy
> =5Rzc
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: "Expire sessions" button in Tomcat Manager

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub,

On 4/30/2011 9:19 PM, Jakub Królikowski wrote:
> In Tomcat Manager, on the application list, there is a button "Expire
> sessions"  available only for "/manager" application.
> 
> How should I configure tomcat to get this button for my application
> ("/") as well?

Take a look at the manager webapp's source code. I suspect it uses JMX
to inspect the session manager and invalidate each session ... or maybe
the session manager has an "invalidate all sessions" operation you can
perform.

If you don't feel like reading the source, you can write your own
HttpSessionListener, register all sessions that get created (remember to
de-register them when they are invalidated), and then consult that when
you want to expire all sessions.

Why do you want do expire all sessions at once?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2+uyEACgkQ9CaO5/Lv0PDM2ACgj6YUb8HtH6QhF/lVVpyOaNLK
Bu0AnR5u9zar07AIZ6FdV2C08qbgbupy
=5Rzc
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org