Solved

How to find active session in tomcat?

Posted on 2014-12-09
4
2,276 Views
Last Modified: 2014-12-26
I am running tomcat server with a java application. We are using spring for session management, I would like to know how can I find the active session?
0
Comment
Question by:beer9
  • 2
4 Comments
 
LVL 35

Expert Comment

by:mccarl
ID: 40490143
how can I find the active session?
What do you mean by "the active session" ?  There is no concept of any one session being active. Did you mean to ask... "how can I find all the currently active sessions?"

Secondly, can you tell us if you are trying to do this from within the Java application that is running on Tomcat or from some application/tool external to the running Tomcat instance?
0
 

Author Comment

by:beer9
ID: 40490380
My query is 'how can I find all the currently active sessions?' :-) so that when there are minimal user 'logged-in' then I can restart my application to fix something.

I have root level access to tomcat, if there is any tool which can help me get this info then I really appreciate it :-)
0
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 40490439
Does your tomcat installation still have the "manager" webapp that comes in the standard distribution? (Look in tomcat's webapps folder to see if there is a "manager" folder) If so, then you already have your tool to view active sessions. Access to the manager app is disabled by default, but you just need to add your own username/password with the correct role (probably "manager-gui" role) to Tomcat. For the procedure and a bit more background on the configuration, refer here...

http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html

Once logged in, the very first page that you are presented with will give you the information that you require. Here is an example screenshot showing a list of applications configured for the Tomcat instance, and for each one it shows the number of sessions.

Now that should fulfil what you have asked for above, but you can go further if you wished. By clicking on the link for your particular application, you can actually list all the sessions and even see some/all of the data associated with each session. You may be able to use this to actually find usernames of the people that own each session, say if you wanted to contact them to tell them that the app will be restarted.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now