geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yunfen...@apache.org
Subject svn commit: r678390 - /geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
Date Mon, 21 Jul 2008 11:18:43 GMT
Author: yunfengma
Date: Mon Jul 21 04:18:43 2008
New Revision: 678390

URL: http://svn.apache.org/viewvc?rev=678390&view=rev
Log:
G4188 -- View Server portlet runs in unhandled exception if the statistics bean is not available

Modified:
    geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp

Modified: geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp?rev=678390&r1=678389&r2=678390&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
(original)
+++ geronimo/server/trunk/plugins/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
Mon Jul 21 04:18:43 2008
@@ -31,6 +31,7 @@
 <%@ page import="java.sql.ResultSet" %>
 <%@ page import="java.sql.SQLException" %>
 <%@ page import="java.sql.Timestamp" %>
+<%@ page import="javax.management.InstanceNotFoundException" %>
 <%@ page import="org.apache.geronimo.monitoring.console.util.*" %>
 <%@ page import="org.apache.geronimo.monitoring.console.MRCConnector" %>
 <portlet:defineObjects/>
@@ -204,7 +205,14 @@
             {
                 String prettyBean = it.next().toString();
                 Set<String> statAttributes = mrc.getStatAttributesOnMBean(trackedBeansMap.get(prettyBean));
-                HashMap<String, Long> beanStats = mrc.getStats(trackedBeansMap.get(prettyBean));
+                boolean started = true;
+                HashMap<String, Long> beanStats = null;
+                try {
+                    beanStats = mrc.getStats(trackedBeansMap.get(prettyBean));
+                } catch (InstanceNotFoundException infe) {
+                    //The bean is not available
+                    started = false;
+                }
                 if ((counter%3) == 0)
                 {
                  %>
@@ -216,14 +224,20 @@
                 <table style="padding-left: 8px; padding-bottom: 10px;">
                 <tr><th colspan="2"><%=prettyBean%></th></tr>
                 <%
-                for (Iterator <String> itt = statAttributes.iterator(); itt.hasNext();)
-                {
-                    String dataName = itt.next().toString();
+                if (started) {
+                    for (Iterator <String> itt = statAttributes.iterator(); itt.hasNext();)
+                    {
+                        String dataName = itt.next().toString();
                 %>
-                    <tr><td><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddGraph" /><portlet:param name="server_id" value="<%=server_id%>"
/><portlet:param name="mbean" value="<%=trackedBeansMap.get(prettyBean)%>" /><portlet:param
name="dataname" value="<%=dataName%>" /></portlet:actionURL>"><%=dataName%></a></td><td><%=beanStats.get(dataName)
%></td></tr>
+                        <tr><td><a href="<portlet:actionURL portletMode="edit"><portlet:param
name="action" value="showAddGraph" /><portlet:param name="server_id" value="<%=server_id%>"
/><portlet:param name="mbean" value="<%=trackedBeansMap.get(prettyBean)%>" /><portlet:param
name="dataname" value="<%=dataName%>" /></portlet:actionURL>"><%=dataName%></a></td><td><%=beanStats.get(dataName)
%></td></tr>
                 <%
-                }
+                    }
+                } else {
                 %>
+                    <tr><td>The statistics bean is not available now.</td></tr>
+                <%
+                }
+                %>                
                 </table>
                 </td>
                 <%



Mime
View raw message