tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r612988 - in /tomcat/trunk: java/org/apache/catalina/manager/LocalStrings.properties java/org/apache/catalina/manager/ManagerServlet.java webapps/docs/changelog.xml
Date Thu, 17 Jan 2008 21:34:34 GMT
Author: pero
Date: Thu Jan 17 13:34:33 2008
New Revision: 612988

URL: http://svn.apache.org/viewvc?rev=612988&view=rev
Log:
Fix ManagerServlet.exipreSession throws Exceptions as iterate longer session lists at production
servers.

Modified:
    tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties?rev=612988&r1=612987&r2=612988&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties Thu Jan 17 13:34:33
2008
@@ -73,6 +73,7 @@
 managerServlet.noDirectory=FAIL - Non-directory document base for path {0}
 managerServlet.noDocBase=FAIL - Cannot undeploy document base for path {0}
 managerServlet.noGlobal=FAIL - No global JNDI resources are available
+managerServlet.noManager=FAIL - No manager exists for path {0}
 managerServlet.noReload=FAIL - Reload not supported on WAR deployed at path {0}
 managerServlet.noRename=FAIL - Cannot deploy uploaded WAR for path {0}
 managerServlet.noRole=FAIL - User does not possess role {0}

Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=612988&r1=612987&r2=612988&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Thu Jan 17 13:34:33
2008
@@ -47,6 +47,7 @@
 import org.apache.catalina.Globals;
 import org.apache.catalina.Host;
 import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Manager;
 import org.apache.catalina.Role;
 import org.apache.catalina.Server;
 import org.apache.catalina.ServerFactory;
@@ -1115,8 +1116,14 @@
                                             RequestUtil.filter(displayPath)));
                 return;
             }
+            Manager manager = context.getManager() ;
+            if(manager == null) {
+                writer.println(sm.getString("managerServlet.noManager",
+                        RequestUtil.filter(displayPath)));
+                return;               
+            }
             int maxCount = 60;
-            int maxInactiveInterval = context.getManager().getMaxInactiveInterval()/60;
+            int maxInactiveInterval = manager.getMaxInactiveInterval()/60;
             int histoInterval = maxInactiveInterval / maxCount;
             if ( histoInterval * maxCount < maxInactiveInterval ) 
                 histoInterval++;
@@ -1127,13 +1134,13 @@
             writer.println(sm.getString("managerServlet.sessions", displayPath));
             writer.println(sm.getString("managerServlet.sessiondefaultmax",
                                 "" + maxInactiveInterval));
-            Session [] sessions = context.getManager().findSessions();
+            Session [] sessions = manager.findSessions();
             int [] timeout = new int[maxCount];
             int notimeout = 0;
             int expired = 0;
             long now = System.currentTimeMillis();
             for (int i = 0; i < sessions.length; i++) {
-                int time = (int)((now-sessions[i].getLastAccessedTime())/1000);
+                int time = (int)((now-sessions[i].getLastAccessedTimeInternal())/1000);
                 if (idle >= 0 && time >= idle*60) {
                     sessions[i].expire();
                     idle++;

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=612988&r1=612987&r2=612988&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jan 17 13:34:33 2008
@@ -46,6 +46,9 @@
   </subsection>
   <subsection name="Catalina">
     <changelog>
+      <fix>
+        Fix ManagerServlet.exipreSession throws Exceptions as iterate longer session lists
at production servers (pero)
+      </fix>
       <add>
         Add ManagerBase session getLastAccessedTimestamp and getCreationTimestamp for better
         remote JMX access. (pero)



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


Mime
View raw message