Solved

How to find active session in tomcat?

Posted on 2014-12-09
4
2,823 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
web application structure 18 100
jsp login check 12 43
Is Applet the way to go for my drag and drop system? 8 25
DNS CNAME records visibility on a web server 2 13
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

828 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