ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r390642 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/http/AxisAdminServlet.java core/src/org/apache/axis2/transport/http/AxisServlet.java webapp/conf/web.xml
Date Sat, 01 Apr 2006 10:51:07 GMT
Author: deepal
Date: Sat Apr  1 02:51:05 2006
New Revision: 390642

URL: http://svn.apache.org/viewcvs?rev=390642&view=rev
Log:
-fixing 240
- I will send a mail to list explaining the solution 

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/webapp/conf/web.xml

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java?rev=390642&r1=390641&r2=390642&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisAdminServlet.java
Sat Apr  1 02:51:05 2006
@@ -25,7 +25,7 @@
  * 
  */
 public class AxisAdminServlet extends AxisServlet {
-    protected ListingAgent lister;
+    protected transient ListingAgent lister;
 
     protected void doGet(HttpServletRequest req,
                          HttpServletResponse resp) throws ServletException, IOException {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=390642&r1=390641&r2=390642&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
Sat Apr  1 02:51:05 2006
@@ -19,7 +19,6 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.util.UUIDGenerator;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
@@ -31,6 +30,7 @@
 import org.apache.axis2.engine.AxisEngine;
 import org.apache.axis2.engine.ListenerManager;
 import org.apache.axis2.transport.TransportListener;
+import org.apache.axis2.util.UUIDGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -59,9 +59,9 @@
     public static final String SESSION_ID = "SessionId";
     protected transient ConfigurationContext configContext;
     protected transient AxisConfiguration axisConfiguration;
-    protected ListingAgent lister;
+    protected transient ListingAgent lister;
 
-    protected ServletConfig servletConfig;
+    protected transient ServletConfig servletConfig;
 
     protected MessageContext createAndSetInitialParamsToMsgCtxt(Object sessionContext,
                                                                 MessageContext msgContext,
HttpServletResponse httpServletResponse,
@@ -224,7 +224,7 @@
     }
 
     public void init() throws ServletException {
-        if(this.servletConfig != null){
+        if (this.servletConfig != null) {
             init(this.servletConfig);
         }
     }
@@ -239,18 +239,28 @@
         try {
             ServletContext context = config.getServletContext();
             String repoDir = config.getInitParameter("repository");
-            if(repoDir == null || repoDir.trim().length() == 0){
-                repoDir = context.getRealPath("/WEB-INF");
-            } else {
-                repoDir = context.getRealPath(repoDir);
+            File rootDir = null;
+            if (repoDir == null) {
+                try {
+                    repoDir = context.getRealPath("/WEB-INF");
+                    rootDir = new File(context.getRealPath("/WEB-INF"));
+                    setWebLocationProperty(context);
+                } catch (Exception e) {
+                    String user_home = System.getProperty("user.home");
+                    File axis2repo = new File(user_home, "axis2repository");
+                    if (axis2repo.exists()) {
+                        repoDir = axis2repo.getAbsolutePath();
+                        log.error("Axis2 run using the repositoty found in : " + repoDir);
+                    } else {
+                        log.error("Axis2 run without having a repository");
+                    }
+                }
             }
-
             //adding weblocation property
-            setWebLocationProperty(context);
             ConfigurationContext configContext =
                     ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoDir,
null);
             configContext.setProperty(Constants.CONTAINER_MANAGED, Constants.VALUE_TRUE);
-            configContext.setRootDir(new File(context.getRealPath("/WEB-INF")));
+            configContext.setRootDir(rootDir);
             return configContext;
         } catch (Exception e) {
             throw new ServletException(e);
@@ -343,7 +353,7 @@
     }
 
     protected MessageContext createMessageContext(HttpServletRequest req,
-                                                HttpServletResponse resp) throws IOException
{
+                                                  HttpServletResponse resp) throws IOException
{
         MessageContext msgContext = new MessageContext();
         String trsPrefix = req.getRequestURL().toString();
         int sepindex = trsPrefix.indexOf(':');
@@ -366,7 +376,7 @@
         requestURI = requestURI.replaceFirst("rest", "services");
         msgContext.setTo(new EndpointReference(requestURI));
         msgContext.setProperty(Constants.OUT_TRANSPORT_INFO,
-                               new ServletBasedOutTransportInfo(resp));
+                new ServletBasedOutTransportInfo(resp));
 //        msgContext.setProperty(MessageContext.TRANSPORT_OUT, resp.getOutputStream());
 
         // set the transport Headers

Modified: webservices/axis2/trunk/java/modules/webapp/conf/web.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/webapp/conf/web.xml?rev=390642&r1=390641&r2=390642&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/webapp/conf/web.xml (original)
+++ webservices/axis2/trunk/java/modules/webapp/conf/web.xml Sat Apr  1 02:51:05 2006
@@ -8,10 +8,10 @@
         <servlet-name>AxisServlet</servlet-name>
         <display-name>Apache-Axis Servlet</display-name>
         <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
-        <init-param>
-            <param-name>repository</param-name>
-            <param-value>/WEB-INF</param-value>
-        </init-param>
+        <!--<init-param>-->
+            <!--<param-name>repository</param-name>-->
+            <!--<param-value>/WEB-INF</param-value>-->
+        <!--</init-param>-->
         <load-on-startup>1</load-on-startup>
     </servlet>
 



Mime
View raw message