You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/06/07 07:16:10 UTC

svn commit: r188695 - in /webservices/axis/trunk/java/modules/core: html/ src/org/apache/axis/ src/org/apache/axis/deployment/ src/org/apache/axis/engine/ src/org/apache/axis/transport/http/

Author: deepal
Date: Mon Jun  6 22:16:09 2005
New Revision: 188695

URL: http://svn.apache.org/viewcvs?rev=188695&view=rev
Log:
added a jsp page to show the deployment time module exceptions

Added:
    webservices/axis/trunk/java/modules/core/html/errorModule.jsp
Modified:
    webservices/axis/trunk/java/modules/core/html/listModules.jsp
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java

Added: webservices/axis/trunk/java/modules/core/html/errorModule.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/html/errorModule.jsp?rev=188695&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/html/errorModule.jsp (added)
+++ webservices/axis/trunk/java/modules/core/html/errorModule.jsp Mon Jun  6 22:16:09 2005
@@ -0,0 +1,21 @@
+<%@ page import="org.apache.axis.Constants,
+                 java.util.Hashtable"%>
+ <%--
+  Created by IntelliJ IDEA.
+  User: me
+  Date: Jun 7, 2005
+  Time: 10:51:02 AM
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+  <head><title>Errorness Modules</title></head>
+  <body>
+  <%
+      Hashtable errornessModules =(Hashtable)request.getSession().getAttribute(Constants.ERROR_MODULE_MAP);
+      String moduleName = (String)request.getParameter("moduleName");
+  %> <h3>The Module has deployment faults</h3><%
+  %><font color="red" ><%=(String)errornessModules.get(moduleName) %></font><%
+  %>
+  </body>
+</html>
\ No newline at end of file

Modified: webservices/axis/trunk/java/modules/core/html/listModules.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/html/listModules.jsp?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/html/listModules.jsp (original)
+++ webservices/axis/trunk/java/modules/core/html/listModules.jsp Mon Jun  6 22:16:09 2005
@@ -37,24 +37,37 @@
   <body>
   <h1>Available Modules</h1>
      <%
+         boolean foundModules = false;
          HashMap moduleMap = (HashMap)request.getSession().getAttribute(Constants.MODULE_MAP);
+         Hashtable errornesModules =(Hashtable)request.getSession().getAttribute(Constants.ERROR_MODULE_MAP);
          if (moduleMap!=null && !moduleMap.isEmpty()){
              String modulename = "";
              Collection moduleNames = moduleMap.values();
-             boolean foundModules = false;
              for (Iterator iterator = moduleNames.iterator(); iterator.hasNext();) {
                  foundModules = true;
                  ModuleDescription  moduleQName = (ModuleDescription) iterator.next();
                  modulename = moduleQName.getName().getLocalPart();
      %><hr><h2><font color="blue"><%=modulename%></font></h2>
-     <br> <%
+     <br>
+      <%
+             }
+        }
+      %>
+      <hr><h3><font color="blue">Faulty Modules</font></h3>
+             <%
+             Enumeration faultyModules = errornesModules.keys();
+             while (faultyModules.hasMoreElements()) {
+                 foundModules = true;
+                 String faultyModuleName = (String) faultyModules.nextElement();
+             %><h3><font color="blue"><a href="errorModule.jsp?moduleName=<%=faultyModuleName%>">
+                    <%=faultyModuleName%></a></font></h3>
+                    <%
              }
              if(! foundModules) {
                  %>
                  <h2><font color="blue">There is no module deployed in the system</font></h2>
                  <%
              }
-         }
      %>
   </body>
 </html>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Mon Jun  6 22:16:09 2005
@@ -141,6 +141,7 @@
      * Errorness servcie
      */
     public static final String ERROR_SERVICE_MAP = "errprservicemap";
+    public static final String ERROR_MODULE_MAP = "errormodulesmap";
 
     public static final String IS_FAULTY = "Fault";
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Mon Jun  6 22:16:09 2005
@@ -565,6 +565,7 @@
                         }
                         break;
                     case MODULE:
+                        String moduleStatus = "";
                         try {
                             ModuleDescription metaData = new ModuleDescription();
                             archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, metaData);
@@ -573,10 +574,15 @@
                         } catch (DeploymentException e) {
                             log.info("Invalid module" + currentArchiveFile.getName());
                             log.info("DeploymentException  " + e);
+                            moduleStatus = "Error:\n" + e.getMessage();
                         } catch (AxisFault axisFault) {
                             log.info("Invalid module" + currentArchiveFile.getName());
                             log.info("AxisFault  " + axisFault);
+                            moduleStatus = "Error:\n" + axisFault.getMessage();
                         } finally {
+                             if (moduleStatus.startsWith("Error:")) {
+                                axisConfig.getFaulytModules().put(getAxisServiceName(currentArchiveFile.getName()), moduleStatus);
+                            }
                             currentArchiveFile = null;
                         }
                         break;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfiguration.java Mon Jun  6 22:16:09 2005
@@ -119,6 +119,7 @@
     public HashMap getServices();
 
     public Hashtable getFaulytServices();
+    public Hashtable getFaulytModules();
 
     public TransportInDescription getTransportIn(QName name) throws AxisFault;
     public void addTransportIn(TransportInDescription transport) throws AxisFault;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisConfigurationImpl.java Mon Jun  6 22:16:09 2005
@@ -34,6 +34,8 @@
      */
     private Hashtable errornesServices;
 
+    private Hashtable errornesModules;
+
     /**
      * Field modules
      */
@@ -91,6 +93,7 @@
         inFaultPhases = new ArrayList();
         outFaultPhases = new ArrayList();
         errornesServices = new Hashtable();
+        errornesModules = new Hashtable();
 
         inPhasesUptoAndIncludingPostDispatch = new ArrayList();
         inPhasesUptoAndIncludingPostDispatch.add(new Phase(PhaseMetadata.PHASE_TRANSPORTIN));
@@ -115,6 +118,10 @@
         return errornesServices;
     }
 
+    public Hashtable getFaulytModules() {
+        return errornesModules;  
+    }
+
     /**
      * Method addMdoule
      *
@@ -333,7 +340,7 @@
         engagedModules.add(moduleref);
         if(isNewmodule){
             addMdoule(module);
-        }  
+        }
     }
     
     public boolean isEngaged(QName moduleName){

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java?rev=188695&r1=188694&r2=188695&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/AxisServlet.java Mon Jun  6 22:16:09 2005
@@ -343,6 +343,9 @@
         HashMap modules =
             ((AxisConfigurationImpl) engineContext.getAxisConfiguration()).getModules();
         req.getSession().setAttribute(Constants.MODULE_MAP, modules);
+        req.getSession().setAttribute(
+            Constants.ERROR_MODULE_MAP,
+            engineContext.getAxisConfiguration().getFaulytModules());
         res.sendRedirect(LIST_AVAILABLE_MODULES_JSP_NAME);
     }