Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to find active session in tomcat?

Posted on 2014-12-09
4
Medium Priority
?
4,036 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 36

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 36

Accepted Solution

by:
mccarl earned 1500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
A solution for Fortify Path Manipulation.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

610 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