You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/03/09 05:24:54 UTC

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

Author: deepal
Date: Tue Mar  8 20:24:52 2005
New Revision: 156610

URL: http://svn.apache.org/viewcvs?view=rev&rev=156610
Log:
To see the deployment time exceptions, modify jsps and some classes , since if there is any error with the service that is going to be deployed previously it was not visble to user he has to go and check the log. but now when he go to listservcies page he can see the deployment time exption.

Modified:
    webservices/axis/trunk/java/modules/core/src/html/listServices.jsp
    webservices/axis/trunk/java/modules/core/src/html/listSingleService.jsp
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
    webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/AxisServlet.java
    webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java

Modified: webservices/axis/trunk/java/modules/core/src/html/listServices.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/html/listServices.jsp?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/html/listServices.jsp (original)
+++ webservices/axis/trunk/java/modules/core/src/html/listServices.jsp Tue Mar  8 20:24:52 2005
@@ -1,9 +1,7 @@
-<%@ page import="java.util.Collection,
-                 java.util.HashMap,
-                 java.util.Iterator,
-                 org.apache.axis.description.AxisService,
+<%@ page import="org.apache.axis.description.AxisService,
                  org.apache.axis.Constants,
-                 org.apache.axis.description.AxisOperation"%>
+                 org.apache.axis.description.AxisOperation,
+                 java.util.*"%>
  <%--
     /*
  * Copyright 2002,2004 The Apache Software Foundation.
@@ -32,18 +30,20 @@
   <br/><a href="<%=Constants.LISTSERVICES%>"> Refresh  </a><br/>
      <%
         HashMap serviceMap = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
+        Hashtable errornessservice =(Hashtable)request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+         boolean status = false;
         if (serviceMap!=null && !serviceMap.isEmpty()){
         HashMap operations;
         String serviceName = "";
         Collection servicecol = serviceMap.values();
         Collection operationsList;
-
        for (Iterator iterator = servicecol.iterator(); iterator.hasNext();) {
             AxisService axisService = (AxisService) iterator.next();
             operations = axisService.getOperations();
             operationsList = operations.values();
             serviceName = axisService.getName().getLocalPart();
-            %><hr><h3><font color="blue"><%=serviceName%></font></h3><%
+            %><hr><h3><font color="blue"><%=serviceName%></font></h3>
+           <%
             if (operationsList.size() > 0) {
                 %><i>Available operations</i><%
             } else {
@@ -54,10 +54,28 @@
                 AxisOperation axisOperation = (AxisOperation) iterator1.next();
                 %><li><%=axisOperation.getName().getLocalPart()%></li><%
             }
-           %></ul><%
+           %></ul>
+           <%
+           status = true;
         }
-         request.getSession().removeAttribute(Constants.SERVICE_MAP);   
-        }else{
+        }
+        if(errornessservice != null){
+            if(errornessservice.size() > 0){
+                request.getSession().setAttribute(Constants.IS_FAULTY,Constants.IS_FAULTY);
+                %>
+                 <hr><h3><font color="blue">Faulty Services</font></h3>
+                <%
+                Enumeration faultyservices = errornessservice.keys();
+                while (faultyservices.hasMoreElements()) {
+                    String faultyserviceName = (String) faultyservices.nextElement();
+                    %><h3><font color="blue"><a href="listSingleService.jsp?serviceName=<%=faultyserviceName%>">
+                    <%=faultyserviceName%></a></font></h3>
+                    <%
+                }
+            }
+           request.getSession().removeAttribute(Constants.SERVICE_MAP);
+           status = true;
+        }if(!status){
             %> There seems to be no services listed! Try hitting refresh <%
         }
        %>

Modified: webservices/axis/trunk/java/modules/core/src/html/listSingleService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/html/listSingleService.jsp?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/html/listSingleService.jsp (original)
+++ webservices/axis/trunk/java/modules/core/src/html/listSingleService.jsp Tue Mar  8 20:24:52 2005
@@ -3,7 +3,8 @@
                  java.util.HashMap,
                  java.util.Collection,
                  org.apache.axis.description.AxisService,
-                 org.apache.axis.Constants"%>
+                 org.apache.axis.Constants,
+                 java.util.Hashtable"%>
  <%--
   Created by IntelliJ IDEA.
   User: Ajith
@@ -23,7 +24,15 @@
         <%
             AxisService service = (AxisService)request.getSession().getAttribute(Constants.SINGLE_SERVICE);
             //System.out.println("service = " + service);
-            if (service!=null){
+            String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
+            System.out.println("isFault = " + isFault);
+            if(Constants.IS_FAULTY.equals(isFault)){
+                Hashtable errornessservices =(Hashtable)request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
+                String servicName = (String)request.getParameter("serviceName");
+                %> <h3>This Web service has deployment faults</h3><%
+                %><font color="red" ><%=(String)errornessservices.get(servicName) %></font><%
+
+            }else  if (service!=null){
             %> <h2>This location contains a web service</h2><%
                 HashMap operations;
                 Collection operationsList;

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/Constants.java Tue Mar  8 20:24:52 2005
@@ -95,6 +95,18 @@
     public static final String SERVICE_MAP = "servicemap";
 
     /**
+     * Errorness servcie
+     */
+    public static final String ERROR_SERVICE_MAP = "errprservicemap";
+
+    public static final String IS_FAULTY = "Fault";
+
+
+
+
+
+
+    /**
      * Field SINGLE_SERVICE
      */
     public static final String SINGLE_SERVICE = "singleservice";

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistry.java Tue Mar  8 20:24:52 2005
@@ -17,6 +17,7 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Hashtable;
 
 import javax.xml.namespace.QName;
 
@@ -135,4 +136,6 @@
      * @return
      */
     public HashMap getServices();
+
+    public Hashtable getFaulytServices();
 }

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/engine/EngineRegistryImpl.java Tue Mar  8 20:24:52 2005
@@ -17,6 +17,7 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Hashtable;
 
 import javax.xml.namespace.QName;
 
@@ -30,6 +31,11 @@
  */
 public class EngineRegistryImpl implements EngineRegistry {
     /**
+     * To store Erroness services
+     */
+    private  Hashtable errornesServices;
+
+    /**
      * Field modules
      */
     private final HashMap modules = new HashMap();
@@ -62,6 +68,7 @@
     public EngineRegistryImpl(AxisGlobal global) {
         this.global = global;
         phases = new ArrayList();
+        errornesServices = new Hashtable();
     }
 
     /**
@@ -71,6 +78,10 @@
      */
     public HashMap getServices() {
         return services;
+    }
+
+    public Hashtable getFaulytServices() {
+        return  errornesServices;
     }
 
     /**

Modified: webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/AxisServlet.java?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/AxisServlet.java (original)
+++ webservices/axis/trunk/java/modules/core/src/java/org/apache/axis/transport/http/AxisServlet.java Tue Mar  8 20:24:52 2005
@@ -192,6 +192,7 @@
             throws IOException {
         HashMap services = engineRegistry.getServices();
         req.getSession().setAttribute(Constants.SERVICE_MAP, services);
+        req.getSession().setAttribute(Constants.ERROR_SERVICE_MAP, engineRegistry.getFaulytServices());
         res.sendRedirect(LIST_MULTIPLE_SERVICE_JSP_NAME);
     }
 

Modified: webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java?view=diff&r1=156609&r2=156610
==============================================================================
--- webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/deployment/src/java/org/apache/axis/deployment/DeploymentEngine.java Tue Mar  8 20:24:52 2005
@@ -53,12 +53,14 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.HashMap;
 
 
 public class DeploymentEngine implements DeploymentConstants {
     private Log log = LogFactory.getLog(getClass());
     private static Scheduler scheduler;
 
+
     private boolean hotdeployment = true;   //to do hot deployment or not
     private boolean hotupdate = true;  // to do hot update or not
 
@@ -414,10 +416,11 @@
                 currentFileItem = (HDFileItem) wsToDeploy.get(i);
                 int type = currentFileItem.getType();
                 UnZipJAR unZipJAR = new UnZipJAR();
+                String serviceStatus ="";
                 switch (type) {
                     case SERVICE:
                         try {
-//
+
                             AxisService service = new AxisService();
                             unZipJAR.unzipService(currentFileItem.getAbsolutePath(), this, service);
                             addnewService(service);
@@ -425,16 +428,19 @@
                         } catch (DeploymentException de) {
                             log.info("Invalid service" + currentFileItem.getName() );
                             log.info("DeploymentException  " + de);
-                            de.printStackTrace();
+                            serviceStatus = "Error:\n" + de.getMessage();
                         } catch (AxisFault axisFault) {
                             log.info("Invalid service" + currentFileItem.getName() );
                             log.info("AxisFault  " + axisFault);
-                            axisFault.printStackTrace();
+                            serviceStatus = "Error:\n" + axisFault.getMessage();
                         } catch (Exception e) {
                             log.info("Invalid service" + currentFileItem.getName() );
                             log.info("Exception  " + e);
-                            e.printStackTrace();
+                            serviceStatus = "Error:\n" + e.getMessage();
                         } finally {
+                            if(serviceStatus.startsWith("Error:")) {
+                                 engineRegistry.getFaulytServices().put(getAxisServiceName(currentFileItem.getName()),serviceStatus);
+                            }
                             currentFileItem = null;
                         }
                         break;
@@ -473,6 +479,7 @@
                         engineRegistry.removeService(new QName(serviceName));
                         log.info("UnDeployement WS Name  " + wsInfo.getFilename());
                     }
+                     engineRegistry.getFaulytServices().remove(serviceName);
                 }
 
             }
@@ -502,5 +509,6 @@
         }
         return fileName;
     }
+
 
 }