Author: remy.maucherat(a)jboss.com
Date: 2008-01-22 10:30:40 -0500 (Tue, 22 Jan 2008)
New Revision: 406
Modified:
trunk/java/org/apache/catalina/manager/LocalStrings.properties
trunk/java/org/apache/catalina/manager/ManagerServlet.java
trunk/webapps/docs/changelog.xml
Log:
Modified: trunk/java/org/apache/catalina/manager/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/catalina/manager/LocalStrings.properties 2008-01-22 14:49:24 UTC
(rev 405)
+++ trunk/java/org/apache/catalina/manager/LocalStrings.properties 2008-01-22 15:30:40 UTC
(rev 406)
@@ -58,6 +58,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: trunk/java/org/apache/catalina/manager/ManagerServlet.java
===================================================================
--- trunk/java/org/apache/catalina/manager/ManagerServlet.java 2008-01-22 14:49:24 UTC
(rev 405)
+++ trunk/java/org/apache/catalina/manager/ManagerServlet.java 2008-01-22 15:30:40 UTC
(rev 406)
@@ -44,6 +44,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.Server;
import org.apache.catalina.ServerFactory;
import org.apache.catalina.Session;
@@ -1059,8 +1060,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++;
@@ -1071,13 +1078,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: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-01-22 14:49:24 UTC (rev 405)
+++ trunk/webapps/docs/changelog.xml 2008-01-22 15:30:40 UTC (rev 406)
@@ -224,6 +224,10 @@
problems when listing contexts. Patch provided by Lucas Galfaso. (markt)
</fix>
</changelog>
+ <fix>
+ Fix ManagerServlet.exipreSession throws Exceptions as iterate longer
+ session lists at production servers. (pero)
+ </fix>
</subsection>
</section>
Show replies by date