synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r563740 - in /webservices/synapse/trunk/java: ./ modules/core/src/main/java/org/apache/synapse/ modules/core/src/main/java/org/apache/synapse/core/axis2/ modules/core/src/main/java/org/apache/synapse/registry/url/ modules/core/src/main/reso...
Date Wed, 08 Aug 2007 04:39:54 GMT
Author: indika
Date: Tue Aug  7 21:39:51 2007
New Revision: 563740

URL: http://svn.apache.org/viewvc?view=rev&rev=563740
Log:
Enable synapse run as a web application
done required changes to configuration + some classes + scripts

Added:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseStartUpServlet.java
    webservices/synapse/trunk/java/repository/conf/web.xml
Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Constants.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
    webservices/synapse/trunk/java/modules/core/src/main/resources/log4j.properties
    webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/LoadbalanceFailoverService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml
    webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/build.xml
    webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat
    webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.sh
    webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml
    webservices/synapse/trunk/java/pom.xml
    webservices/synapse/trunk/java/src/main/assembly/bin.xml
    webservices/synapse/trunk/java/src/main/bin/synapse.bat
    webservices/synapse/trunk/java/src/main/bin/synapse.sh

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Constants.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Constants.java?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Constants.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Constants.java Tue Aug  7 21:39:51 2007
@@ -49,6 +49,9 @@
     /** The system property used to specify/override the synapse home location */
     String SYNAPSE_HOME = "synapse.home";
 
+    /** The synapse conf directory location */
+    String SYNAPSE_CONF_DIRECTORY= "webapp/WEB-INF/classes/conf";
+
     /** a message context property set to hold the relates to for POX responses */
     String RELATES_TO_FOR_POX = "RelatesToForPox";
 

Added: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java?view=auto&rev=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java (added)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java Tue Aug  7 21:39:51 2007
@@ -0,0 +1,168 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.engine.ListenerManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.net.ServerSocket;
+import java.util.Iterator;
+
+/**
+ * To manage the Synapse Server  instances. This class is responsible for
+ * the staring and stopping listeners
+ */
+
+public class ServerManager {
+
+    private static ServerManager instance;
+    private static Log log = LogFactory.getLog(ServerManager.class);
+    public static String axis2Repolocation;
+    private ListenerManager listenerManager;
+    private ConfigurationContext configctx;
+
+    /**
+     * To ensure that there is a only one Manager
+     * @return  Server Manager Instance
+     */
+    public static ServerManager getInstance() {
+        if (instance == null) {
+            instance = new ServerManager();
+        }
+        return instance;
+    }
+
+    /**
+     * starting all the listeners
+     */
+    public void start() {
+
+        if (axis2Repolocation == null) {
+            System.out.println("The Axis2 Repository must be provided");
+            return;
+        }
+        System.out.println("[SynapseServer] Using the Axis2 Repository "
+                           + new File(axis2Repolocation).getAbsolutePath());
+        try {
+            configctx = ConfigurationContextFactory.
+                    createConfigurationContextFromFileSystem(axis2Repolocation, null);
+            
+            listenerManager = configctx.getListenerManager();
+            if (listenerManager == null) {
+                listenerManager = new ListenerManager();
+                listenerManager.init(configctx);
+            }
+            // decide on HTTP port to execute
+            selectPort(configctx);
+
+            Iterator iter = configctx.getAxisConfiguration().
+                    getTransportsIn().keySet().iterator();
+            while (iter.hasNext()) {
+                String trp = (String) iter.next();
+                TransportInDescription trsIn = (TransportInDescription)
+                        configctx.getAxisConfiguration().getTransportsIn().get(trp);
+                listenerManager.addListener(trsIn, false);
+                String msg = "[SynapseServer] Starting transport " + trsIn.getName();
+                if (trsIn.getParameter("port") != null) {
+                    msg += " on port " + trsIn.getParameter("port").getValue();
+                }
+                System.out.println(msg);
+            }
+            System.out.println("[SynapseServer] Ready");
+
+        } catch (Throwable t) {
+            t.printStackTrace();
+            System.out.println("[SynapseServer] Startup failed...");
+        }
+    }
+
+    /**
+     * stop all the listeners
+     */
+    public void stop() {
+        try {
+            if (listenerManager != null) {
+                listenerManager.destroy();
+            }
+            //we need to call this method to clean the team fils we created.
+            if (configctx != null) {
+                configctx.terminate();
+            }
+        } catch (Exception ignored) {
+        }
+    }
+
+    /**
+     * Helper method to select a alternate port if the currently selected port is in use
+     * @param configCtx configuration context 
+     */
+    private static void selectPort(ConfigurationContext configCtx) {
+        // check if configured port is available
+        TransportInDescription trsIn = (TransportInDescription)
+                configCtx.getAxisConfiguration().getTransportsIn().get("http");
+
+        if (trsIn != null) {
+
+            int port = 8080;
+
+            String strPort = System.getProperty("port");
+            if (strPort != null) {
+                // port is specified as a VM parameter
+                try {
+                    port = new Integer(strPort).intValue();
+                } catch (NumberFormatException e) {
+                    // user supplied parameter is not a valid integer. so use the port in configuration.
+                    log.error("Given port is not a valid integer. Port specified in the configuration is used for the server.");
+                    port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
+                }
+
+            } else {
+                port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
+            }
+
+            while (true) {
+                ServerSocket sock = null;
+                try {
+                    sock = new ServerSocket(port);
+                    trsIn.getParameter("port").setValue(Integer.toString(port));
+                    break;
+                } catch (Exception e) {
+                    System.out.println("[SynapseServer] Port " + port + " already in use. Trying alternate");
+                    if (port == 8080) {
+                        port = 8008;
+                    } else {
+                        port++;
+                    }
+                } finally {
+                    if (sock != null) {
+                        try {
+                            sock.close();
+                        } catch (Exception e) {
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
\ No newline at end of file

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/SynapseServer.java Tue Aug  7 21:39:51 2007
@@ -19,19 +19,10 @@
 
 package org.apache.synapse;
 
-import org.apache.axis2.util.OptionsParser;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.engine.ListenerManager;
-import org.apache.axis2.description.TransportInDescription;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
 import java.io.File;
-import java.util.Iterator;
-import java.net.ServerSocket;
-import java.net.Socket;
 
 /**
  * Starts all transports as specified on the axis2.xml
@@ -52,90 +43,8 @@
         if (args.length != 1 || !new File(args[0]).exists()) {
             printUsage();
         }
-
-        System.out.println("[SynapseServer] Using the Axis2 Repository "
-                + new File(args[0]).getAbsolutePath());
-
-        try {
-            ConfigurationContext configctx = ConfigurationContextFactory.
-                createConfigurationContextFromFileSystem(args[0], null);
-
-            ListenerManager listenerManager = configctx.getListenerManager();
-            if (listenerManager == null) {
-                listenerManager = new ListenerManager();
-                listenerManager.init(configctx);
-            }
-
-            // decide on HTTP port to execute
-            selectPort(configctx);
-
-            Iterator iter = configctx.getAxisConfiguration().
-                getTransportsIn().keySet().iterator();
-            while (iter.hasNext()) {
-                String trp = (String) iter.next();
-                TransportInDescription trsIn = (TransportInDescription)
-                    configctx.getAxisConfiguration().getTransportsIn().get(trp);
-                listenerManager.addListener(trsIn, false);
-                String msg = "[SynapseServer] Starting transport " + trsIn.getName();
-                if (trsIn.getParameter("port") != null) {
-                    msg += " on port " + trsIn.getParameter("port").getValue();
-                }
-                System.out.println(msg);
-            }
-            System.out.println("[SynapseServer] Ready");
-
-        } catch (Throwable t) {
-            t.printStackTrace();
-            System.out.println("[SynapseServer] Startup failed...");
-        }
+        ServerManager.axis2Repolocation = args[0];
+        ServerManager serverManager = ServerManager.getInstance();
+        serverManager.start();
     }
-
-    private static void selectPort(ConfigurationContext configCtx) {
-        // check if configured port is available
-        TransportInDescription trsIn = (TransportInDescription)
-            configCtx.getAxisConfiguration().getTransportsIn().get("http");
-
-        if (trsIn != null) {
-
-            int port = 8080;
-
-            String strPort = System.getProperty("port");
-            if(strPort != null) {
-                // port is specified as a VM parameter
-                try {
-                    port = new Integer(strPort).intValue();
-                } catch (NumberFormatException e) {
-                    // user supplied parameter is not a valid integer. so use the port in configuration.
-                    log.error("Given port is not a valid integer. Port specified in the configuration is used for the server.");
-                    port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
-                }
-
-            } else {
-                port = Integer.parseInt(trsIn.getParameter("port").getValue().toString());
-            }
-
-            while (true) {
-                ServerSocket sock = null;
-                try {
-                    sock = new ServerSocket(port);
-                    trsIn.getParameter("port").setValue(Integer.toString(port));
-                    break;
-                } catch (Exception e) {
-                	System.out.println("[SynapseServer] Port "+port+" already in use. Trying alternate");
-                    if (port == 8080) {
-                        port = 8008;
-                    } else {
-                        port++;
-                    }
-                } finally {
-                    if (sock != null) {
-                        try {
-                            sock.close();
-                        } catch (Exception e) {}
-                    }
-                }
-            }
-        }
-    }
-
 }

Added: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java?view=auto&rev=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java (added)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java Tue Aug  7 21:39:51 2007
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.core.axis2;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.transport.http.AxisServlet;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+/**
+ *Extends axis2 servlet functionality so that  avoid  starting listeners again
+ */
+
+public class SynapseAxisServlet extends AxisServlet {
+
+
+    /**
+     * Overrides init method so that avoid  starting listeners again
+     * @param config
+     * @throws ServletException
+     */
+    public void init(ServletConfig config) throws ServletException {
+        ServletContext servletContext = config.getServletContext();
+        this.configContext =
+                (ConfigurationContext) servletContext.getAttribute(CONFIGURATION_CONTEXT);
+        this.axisConfiguration = this.configContext.getAxisConfiguration();
+        servletContext.setAttribute(this.getClass().getName(), this);
+        this.servletConfig = config;
+        initParams();
+    }
+}

Added: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseStartUpServlet.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseStartUpServlet.java?view=auto&rev=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseStartUpServlet.java (added)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseStartUpServlet.java Tue Aug  7 21:39:51 2007
@@ -0,0 +1,128 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.synapse.core.axis2;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.PropertyConfigurator;
+import org.apache.synapse.Constants;
+import org.apache.synapse.ServerManager;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * This servlet will start and stop all the listeners.
+ */
+
+public class SynapseStartUpServlet extends HttpServlet {
+
+    private static Log log = LogFactory.getLog(SynapseStartUpServlet.class);
+    private ServerManager serverManager;
+
+    public void init() throws ServletException {
+        super.init();
+    }
+
+    public void init(ServletConfig servletConfig) throws ServletException {
+
+        ServletContext servletContext = servletConfig.getServletContext();
+        if ("true".equals(servletContext.getAttribute("hasAlreadyInit"))) {
+            return;
+        }
+        String synapseHome = System.getProperty(Constants.SYNAPSE_HOME);
+        //Setting the all required system properties
+        if (synapseHome == null || "".equals(synapseHome)) {
+            synapseHome = servletConfig.getInitParameter(Constants.SYNAPSE_HOME);
+            if (synapseHome != null) {
+                if (synapseHome.endsWith("/")) {
+                    synapseHome = synapseHome.substring(0, synapseHome.lastIndexOf("/"));
+                }
+                System.setProperty(Constants.SYNAPSE_HOME, synapseHome);
+                try {
+                    //load the synapse log4j properties
+                    URL url = new URL("file:" + synapseHome + File.separator
+                                      + Constants.SYNAPSE_CONF_DIRECTORY + File.separator
+                                      + "log4j.properties");
+                    PropertyConfigurator.configure(url);
+                } catch (MalformedURLException ignore) {
+                }
+                //setting axis2 repository location
+                String axis2Repo = System.getProperty(org.apache.axis2.Constants.AXIS2_REPO);
+                if (axis2Repo == null) {
+                    ServerManager.axis2Repolocation = synapseHome +
+                                                      File.separator + "repository";
+                    System.setProperty(org.apache.axis2.Constants.AXIS2_REPO,
+                                       synapseHome +
+                                       File.separator + "repository");
+                }
+                //setting axis2 configuration location
+                String axis2Xml = System.getProperty(org.apache.axis2.Constants.AXIS2_CONF);
+                if (axis2Xml == null) {
+                    System.setProperty(org.apache.axis2.Constants.AXIS2_CONF,
+                                       synapseHome + File.separator
+                                       + Constants.SYNAPSE_CONF_DIRECTORY
+                                       + File.separator + org.apache.axis2.Constants.AXIS2_CONF);
+                }
+                //setting synapse configuration location
+                String synapseXml = System.getProperty(org.apache.synapse.Constants.SYNAPSE_XML);
+                if (synapseXml == null) {
+                    System.setProperty(org.apache.synapse.Constants.SYNAPSE_XML,
+                                       synapseHome + File.separator
+                                       + Constants.SYNAPSE_CONF_DIRECTORY
+                                       + File.separator + org.apache.synapse.Constants.SYNAPSE_XML);
+                }
+            } else {
+                log.fatal("synapse.home had not set : startup failed");
+                return;
+            }
+        }
+        serverManager = ServerManager.getInstance();
+        serverManager.start();
+        servletContext.setAttribute("hasAlreadyInit", "true");
+    }
+
+
+    protected void doGet(HttpServletRequest request,
+                         HttpServletResponse response) throws ServletException,
+                                                              IOException {
+    }
+
+    protected void doPost(HttpServletRequest request,
+                          HttpServletResponse response) throws ServletException,
+                                                               IOException {
+    }
+
+    public void destroy() {
+        try {
+            if (serverManager != null) {
+                serverManager.stop(); // will stop all started  listeners
+            }
+        } catch (Exception ignored) {
+        }
+    }
+}

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java Tue Aug  7 21:39:51 2007
@@ -23,6 +23,7 @@
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.Constants;
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.registry.AbstractRegistry;
 import org.apache.synapse.registry.Registry;
@@ -37,7 +38,7 @@
 
 /**
  * A Simple HTTP GET based registry which will work with a Web Server / WebDAV
- *
+ * <p/>
  * This saves the root server URL, and appends the a given key to construct the
  * full URL to locate resources
  */
@@ -53,6 +54,25 @@
         URLConnection urlc = null;
         try {
             URL url = new URL(getRoot() + key);
+            if ("file".equals(url.getProtocol())) {
+                try {
+                    url.openStream();
+                } catch (IOException ignored) {
+                    String synapseHome = System.getProperty(Constants.SYNAPSE_HOME);
+                    if (synapseHome != null) {
+                        if (synapseHome.endsWith("/")) {
+                            synapseHome = synapseHome.substring(0, synapseHome.lastIndexOf("/"));
+                        }
+                        url = new URL(url.getProtocol() + ":" + synapseHome + "/" + url.getPath());
+                        try {
+                            url.openStream();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                            log.error(e);
+                        }
+                    }
+                }
+            }
             urlc = url.openConnection();
             urlc.connect();
         } catch (IOException e) {
@@ -61,7 +81,7 @@
 
         try {
             XMLStreamReader parser = XMLInputFactory.newInstance().
-                createXMLStreamReader(urlc.getInputStream());
+                    createXMLStreamReader(urlc.getInputStream());
             StAXOMBuilder builder = new StAXOMBuilder(parser);
             return builder.getDocumentElement();
 
@@ -83,6 +103,25 @@
         }
         try {
             URL url = new URL(getRoot() + key);
+            if ("file".equals(url.getProtocol())) {
+                try {
+                    url.openStream();
+                } catch (IOException ignored) {
+                    String synapseHome = System.getProperty(Constants.SYNAPSE_HOME);
+                    if (synapseHome != null) {
+                        if (synapseHome.endsWith("/")) {
+                            synapseHome = synapseHome.substring(0, synapseHome.lastIndexOf("/"));
+                        }
+                        url = new URL(url.getProtocol() + ":" + synapseHome + "/" + url.getPath());
+                        try {
+                            url.openStream();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                            log.error(e);
+                        }
+                    }
+                }
+            }
             URLConnection urlc = url.openConnection();
             urlc.setReadTimeout(30000);
             urlc.setRequestProperty("Connection", "Close");
@@ -96,7 +135,7 @@
             wre.setVersion(urlc.getLastModified());
             if (urlc.getExpiration() > 0) {
                 wre.setCachableDuration(
-                    urlc.getExpiration() - System.currentTimeMillis());
+                        urlc.getExpiration() - System.currentTimeMillis());
             } else {
                 wre.setCachableDuration(getCachableDuration());
             }
@@ -114,14 +153,14 @@
 
     public void addConfigProperty(String name, String value) {
 
-        if(name.equals("root")) {
+        if (name.equals("root")) {
 
             // if the root is folder, it should always end with '/'
             // therefore, property keys do not have to begin with '/', which could be misleading
             try {
                 URL url = new URL(value);
-                if(url.getProtocol().equals("file")) {
-                    if(!value.endsWith("/")) {
+                if (url.getProtocol().equals("file")) {
+                    if (!value.endsWith("/")) {
                         value = value + "/";
                     }
                 }
@@ -151,18 +190,36 @@
 
         try {
             URL url;
-            if(entry == null) {
+            if (entry == null) {
                 URLRegistryEntry urlEntry = new URLRegistryEntry();
                 urlEntry.setKey("");
                 entry = urlEntry;
             }
-
             url = new URL(getRoot() + entry.getKey());
+            if ("file".equals(url.getProtocol())) {
+                try {
+                    url.openStream();
+                } catch (IOException ignored) {
+                    String synapseHome = System.getProperty(Constants.SYNAPSE_HOME);
+                    if (synapseHome != null) {
+                        if (synapseHome.endsWith("/")) {
+                            synapseHome = synapseHome.substring(0, synapseHome.lastIndexOf("/"));
+                        }
+                        url = new URL(url.getProtocol() + ":" + synapseHome + "/" + url.getPath());
+                        try {
+                            url.openStream();
+                        } catch (IOException e) {
+                            e.printStackTrace();
+                            log.error(e);
+                        }
+                    }
+                }
+            }
 
-            if(url.getProtocol().equals("file")) {
+            if (url.getProtocol().equals("file")) {
 
                 File file = new File(url.getFile());
-                if(!file.isDirectory()) {
+                if (!file.isDirectory()) {
                     return null;
                 }
 
@@ -173,15 +230,15 @@
                     BufferedReader reader = new BufferedReader(new InputStreamReader(inStream));
                     ArrayList entryList = new ArrayList();
                     String key = "";
-                    while((key=reader.readLine()) != null) {
+                    while ((key = reader.readLine()) != null) {
                         URLRegistryEntry registryEntry = new URLRegistryEntry();
-                        if(entry.getKey().equals("")) {
+                        if (entry.getKey().equals("")) {
                             registryEntry.setKey(key);
                         } else {
-                            if(entry.getKey().endsWith("/")) {
-                                  registryEntry.setKey(entry.getKey() + key);
+                            if (entry.getKey().endsWith("/")) {
+                                registryEntry.setKey(entry.getKey() + key);
                             } else {
-                                  registryEntry.setKey(entry.getKey() + "/" + key);
+                                registryEntry.setKey(entry.getKey() + "/" + key);
                             }
                         }
 
@@ -189,12 +246,12 @@
                     }
 
                     RegistryEntry[] entries = new RegistryEntry[entryList.size()];
-                    for(int i=0; i<entryList.size(); i++) {
+                    for (int i = 0; i < entryList.size(); i++) {
                         entries[i] = (RegistryEntry) entryList.get(i);
                     }
                     return entries;
 
-                } catch(Exception e) {
+                } catch (Exception e) {
                     throw new SynapseException("Error in reading the URL.");
                 }
 
@@ -213,10 +270,10 @@
 
         ArrayList list = new ArrayList();
         RegistryEntry[] entries = getChildren(entry);
-        if(entries != null) {
-            for(int i=0; i<entries.length; i++) {
+        if (entries != null) {
+            for (int i = 0; i < entries.length; i++) {
 
-                if(list.size() > MAX_KEYS) {
+                if (list.size() > MAX_KEYS) {
                     break;
                 }
 
@@ -225,7 +282,7 @@
         }
 
         RegistryEntry[] descendants = new RegistryEntry[list.size()];
-        for(int i=0; i<list.size(); i++) {
+        for (int i = 0; i < list.size(); i++) {
             descendants[i] = (RegistryEntry) list.get(i);
         }
 
@@ -235,10 +292,10 @@
     private void fillDescendants(RegistryEntry parent, ArrayList list) {
 
         RegistryEntry[] entries = getChildren(parent);
-        if(entries != null) {
-            for(int i=0; i<entries.length; i++) {
+        if (entries != null) {
+            for (int i = 0; i < entries.length; i++) {
 
-                if(list.size() > MAX_KEYS) {
+                if (list.size() > MAX_KEYS) {
                     break;
                 }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/resources/log4j.properties?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/resources/log4j.properties (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/resources/log4j.properties Tue Aug  7 21:39:51 2007
@@ -42,7 +42,7 @@
 
 ####  appender writes to a file
 log4j.appender.logfile=org.apache.log4j.RollingFileAppender
-log4j.appender.logfile.File=logs/logfile.log
+log4j.appender.logfile.File=logs/synapse-log.log
 
 
 # Control the maximum log file size

Modified: webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/FastStockQuoteService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/services/LoadbalanceFailoverService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/LoadbalanceFailoverService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/LoadbalanceFailoverService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/LoadbalanceFailoverService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-services">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="services" value="../../repository/services"/>
     <property name="classes" value="${temp.dir}/classes"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/MTOMSwASampleService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/ReliableStockQuoteService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SecureStockQuoteService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/services/SimpleStockQuoteService/build.xml Tue Aug  7 21:39:51 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat (original)
+++ webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.bat Tue Aug  7 21:39:51 2007
@@ -35,7 +35,7 @@
 rem find AXIS2_HOME if it does not exist due to either an invalid value passed
 rem by the user or the %0 problem on Windows 9x
 
-if exist "%AXIS2_HOME%\repository\conf\axis2.xml" goto checkJava
+if exist "%AXIS2_HOME%\..\..\webapp\WEB-INF\classes\conf\axis2.xml" goto checkJava
 
 :noAxis2Home
 echo AXIS2_HOME environment variable is set incorrectly or AXIS2 could not be located.
@@ -88,22 +88,22 @@
 :runAxis2
 rem set the classes by looping through the libs
 setlocal EnableDelayedExpansion
-set AXIS2_CLASS_PATH=%AXIS2_HOME%/../../lib;%AXIS2_HOME%/../../repository/conf
-FOR %%c in ("%AXIS2_HOME%\..\..\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
+set AXIS2_CLASS_PATH=%AXIS2_HOME%/../../webapp/WEB-INF/lib;%AXIS2_HOME%/../../repository/conf
+FOR %%c in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
 
 rem use proper bouncy castle version for the JDK
 
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.4" >NUL
 IF ERRORLEVEL 1 goto checkJdk15
 echo  Using Bouncy castle JAR for Java 1.4
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk13*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
+FOR %%C in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\bcprov-jdk13*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
 goto runServer
 
 :checkJdk15
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.5" >NUL
 IF ERRORLEVEL 1 goto runServer
 echo  Using Bouncy castle JAR for Java 1.5
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk15*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
+FOR %%C in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\bcprov-jdk15*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
 
 :runServer
 set AXIS2_ENDORSED=%AXIS2_HOME%\..\..\lib\endorsed

Modified: webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.sh
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.sh?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.sh (original)
+++ webservices/synapse/trunk/java/modules/samples/src/main/scripts/axis2server.sh Tue Aug  7 21:39:51 2007
@@ -80,12 +80,12 @@
 fi
 
 # update classpath
-AXIS2_CLASSPATH="$AXIS2_HOME/../../lib"
-for f in "$AXIS2_HOME"/../../lib/*.jar
+AXIS2_CLASSPATH="$AXIS2_HOME/../../webapp/WEB-INF/lib"
+for f in "$AXIS2_HOME"/../../webapp/WEB-INF/lib/*.jar
 do
   AXIS2_CLASSPATH="$AXIS2_CLASSPATH":$f
 done
-AXIS2_CLASSPATH="$JAVA_HOME/lib/tools.jar":"$AXIS2_CLASSPATH":"$CLASSPATH"
+AXIS2_CLASSPATH=$AXIS2_HOME/../../webapp/WEB-INF/classes:"$JAVA_HOME/lib/tools.jar":"$AXIS2_CLASSPATH":"$CLASSPATH"
 
 # use proper bouncy castle version for the JDK
 jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`
@@ -93,13 +93,13 @@
 
 if [ "$jdk_15" ]; then
     echo " Using Bouncy castle JAR for Java 1.5"
-    for f in $AXIS2_HOME/../../lib/bcprov-jdk15*.jar
+    for f in $AXIS2_HOME/../../webapp/WEB-INF/lib/bcprov-jdk15*.jar
     do
       AXIS2_CLASSPATH=$f:$AXIS2_CLASSPATH
     done
 elif [ "$jdk_14" ]; then
     echo " Using Bouncy castle JAR for Java 1.4"
-    for f in $AXIS2_HOME/../../lib/bcprov-jdk13*.jar
+    for f in $AXIS2_HOME/../../webapp/WEB-INF/lib/bcprov-jdk13*.jar
     do
       AXIS2_CLASSPATH=$f:$AXIS2_CLASSPATH
     done

Modified: webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml (original)
+++ webservices/synapse/trunk/java/modules/samples/src/main/scripts/build.xml Tue Aug  7 21:39:51 2007
@@ -100,7 +100,7 @@
             <sysproperty key="policy" value="${policy}"/>
             <sysproperty key="rest" value="${rest}"/>
             <sysproperty key="wsrm" value="${wsrm}"/>
-            <sysproperty key="javax.net.ssl.trustStore" value="./../../lib/trust.jks"/>
+            <sysproperty key="javax.net.ssl.trustStore" value="./../../webapp/WEB-INF/classes/conf/trust.jks"/>
             <sysproperty key="javax.net.ssl.trustStorePassword" value="password"/>
             <!--
             <jvmarg value="-Xdebug"/>
@@ -137,7 +137,7 @@
             <sysproperty key="opt_mode" value="${opt_mode}"/>
             <sysproperty key="opt_url"  value="${opt_url}"/>
             <sysproperty key="opt_file" value="${opt_file}"/>
-            <sysproperty key="javax.net.ssl.trustStore" value="./../../lib/trust.jks"/>
+            <sysproperty key="javax.net.ssl.trustStore" value="./../../webapp/WEB-INF/lib/trust.jks"/>
             <sysproperty key="javax.net.ssl.trustStorePassword" value="password"/>
             <!--
             <jvmarg value="-Xdebug"/>
@@ -174,8 +174,8 @@
         <mkdir dir="${class.dir}"/>
         <path id="javac.classpath">
             <pathelement path="${class.dir}"/>
-            <pathelement path="../../lib"/>
-            <fileset dir="../../lib">
+            <pathelement path="../../webapp/WEB-INF/lib"/>
+            <fileset dir="../../webapp/WEB-INF/lib">
                 <include name="**/*.jar"/>
             </fileset>
         </path>

Modified: webservices/synapse/trunk/java/pom.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/pom.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/pom.xml (original)
+++ webservices/synapse/trunk/java/pom.xml Tue Aug  7 21:39:51 2007
@@ -667,6 +667,143 @@
             <version>${quartz.version}</version>
         </dependency>
         
+         <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina</artifactId>
+            <version>${tomcat.version}</version>
+             <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina-optional</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler-jdt</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-runtime</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+          <dependency>
+                <groupId>tomcat</groupId>
+                <artifactId>servlet-api</artifactId>
+                <version>${tomcat.version}</version>
+               <scope>provided</scope>
+            </dependency>
+        <!--<dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>-->
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-factory</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-resources</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!--<dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>-->
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlets-default</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-coyote</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-http</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-util</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-factory-dbcp</artifactId>
+            <version>${tomcat.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+            <version>${mx4j.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-tools</artifactId>
+            <version>${mx4j.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-jmx</artifactId>
+            <version>${mx4j.version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>saxon8</groupId>
+            <artifactId>saxon8</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>saxon8</groupId>
+            <artifactId>saxon8xqj</artifactId>
+            <version>0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>saxon8</groupId>
+            <artifactId>saxon8-dom</artifactId>
+            <version>0.0</version>
+        </dependency>
+        
     </dependencies>
 
     <reporting>
@@ -791,6 +928,8 @@
         <xbean.version>2.2.0</xbean.version>
         <bsf.version>3.0-beta1</bsf.version>
         <groovy.version>1.0</groovy.version>
+        <tomcat.version>5.5.15</tomcat.version>
+        <mx4j.version>3.0.1</mx4j.version>
 
     </properties>
 

Added: webservices/synapse/trunk/java/repository/conf/web.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/repository/conf/web.xml?view=auto&rev=563740
==============================================================================
--- webservices/synapse/trunk/java/repository/conf/web.xml (added)
+++ webservices/synapse/trunk/java/repository/conf/web.xml Tue Aug  7 21:39:51 2007
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ /*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+  -->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
+Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <display-name>Apache Synapse</display-name>
+
+    <servlet>
+        <servlet-name>StartUpServlet</servlet-name>
+        <servlet-class>org.apache.synapse.core.axis2.SynapseStartUpServlet</servlet-class>
+        <!-- synapse.home parameter must have set if synapse is going to deploy in the exsiting tomcat
+         This value must contains the absolute path to the syapase home  -->
+        <!--<init-param>-->
+            <!--<param-name>synapse.home</param-name>-->
+            <!--<param-value>@synapse.home@</param-value>-->
+        <!--</init-param>-->
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>SynapseServlet</servlet-name>
+        <servlet-class>org.apache.synapse.core.axis2.SynapseAxisServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>SynapseServlet</servlet-name>
+        <url-pattern>/soap/*</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <!-- 30 minutes -->
+        <session-timeout>30</session-timeout>
+    </session-config>
+
+
+</web-app>
\ No newline at end of file

Modified: webservices/synapse/trunk/java/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/assembly/bin.xml?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/src/main/assembly/bin.xml (original)
+++ webservices/synapse/trunk/java/src/main/assembly/bin.xml Tue Aug  7 21:39:51 2007
@@ -53,6 +53,26 @@
         <fileSet>
             <directory>repository</directory>
             <outputDirectory>synapse-${synapse.version}/repository</outputDirectory>
+            <excludes>
+                <exclude>conf/axis2.xml</exclude>
+                <exclude>conf/synapse.xml</exclude>
+                <exclude>conf/web.xml</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>repository/conf</directory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/classes/conf</outputDirectory>
+            <includes>
+                <include>axis2.xml</include>
+                <include>synapse.xml</include>                     
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>repository/conf</directory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/</outputDirectory>
+            <includes>
+                <include>web.xml</include>                     
+            </includes>
         </fileSet>
         <fileSet>
             <directory>repository/conf/sample/resources/misc/client</directory>
@@ -63,7 +83,7 @@
         </fileSet>
         <fileSet>
             <directory>modules/core/src/main/resources</directory>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/classes/conf</outputDirectory>
             <includes>
                 <include>log4j.properties</include>
                 <include>identity.jks</include>
@@ -141,51 +161,51 @@
         </fileSet>
 
         <!--<fileSet>-->
-            <!--<directory>target/javadoc</directory>-->
-            <!--<outputDirectory>synapse-${synapse.version}/docs/api</outputDirectory>-->
-            <!--<includes>-->
-                <!--<include>**/*</include>-->
-            <!--</includes>-->
+        <!--<directory>target/javadoc</directory>-->
+        <!--<outputDirectory>synapse-${synapse.version}/docs/api</outputDirectory>-->
+        <!--<includes>-->
+        <!--<include>**/*</include>-->
+        <!--</includes>-->
         <!--</fileSet>-->
         <!--<fileSet>-->
-            <!--<directory>target/additional-libs</directory>-->
-            <!--<outputDirectory>synapse-${synapse.version}/lib</outputDirectory>-->
-            <!--<includes>-->
-                <!--<include>**/*</include>-->
-            <!--</includes>-->
+        <!--<directory>target/additional-libs</directory>-->
+        <!--<outputDirectory>synapse-${synapse.version}/lib</outputDirectory>-->
+        <!--<includes>-->
+        <!--<include>**/*</include>-->
+        <!--</includes>-->
         <!--</fileSet>-->
         <!--<fileSet>-->
-            <!--<directory>target</directory>-->
-            <!--<outputDirectory>synapse-${synapse.version}/lib</outputDirectory>-->
-            <!--<includes>-->
-                <!--<include>synapse.jar</include>-->
-            <!--</includes>-->
+        <!--<directory>target</directory>-->
+        <!--<outputDirectory>synapse-${synapse.version}/lib</outputDirectory>-->
+        <!--<includes>-->
+        <!--<include>synapse.jar</include>-->
+        <!--</includes>-->
         <!--</fileSet>-->
 
         <fileSet>
             <directory>modules/core/target</directory>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>synapse-core-${synapse.version}.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>modules/samples/target</directory>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>synapse-samples-${synapse.version}.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>modules/extensions/target</directory>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>synapse-extensions-${synapse.version}.jar</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>modules/transports/target</directory>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>synapse-transports-${synapse.version}.jar</include>
             </includes>
@@ -193,8 +213,25 @@
     </fileSets>
     <dependencySets>
         <dependencySet>
-            <outputDirectory>synapse-${synapse.version}/lib</outputDirectory>
+            <outputDirectory>synapse-${synapse.version}/webapp/WEB-INF/lib</outputDirectory>
             <excludes>
+                <exclude>tomcat:catalina:jar</exclude>
+                <exclude>tomcat:catalina-optional:jar</exclude>
+                <exclude>tomcat:jasper-compiler:jar</exclude>
+                <exclude>tomcat:jasper-compiler-jdt:jar</exclude>
+                <exclude>tomcat:jasper-runtime:jar</exclude>
+                <exclude>tomcat:naming-factory:jar</exclude>
+                <exclude>tomcat:naming-resources:jar</exclude>
+                <exclude>tomcat:servlets-default:jar</exclude>
+                <exclude>tomcat:tomcat-coyote:jar</exclude>
+                <exclude>tomcat:tomcat-http:jar</exclude>
+                <exclude>tomcat:tomcat-util:jar</exclude>
+                <exclude>tomcat:naming-factory-dbcp:jar</exclude>
+                <exclude>tomcat:tomcat-apr:jar</exclude>
+                <exclude>tomcat:jsp-api:jar</exclude>
+                <exclude>tomcat:servlet-api:jar</exclude>
+                <exclude>mx4j:mx4j-tools:jar</exclude>
+                <exclude>mx4j:mx4j-jmx:jar</exclude>
                 <exclude>org.apache.axis2:addressing:mar</exclude>
                 <exclude>org.apache.rampart:rampart:mar</exclude>
                 <exclude>org.apache.sandesha2:sandesha2:mar</exclude>
@@ -207,7 +244,7 @@
                 <exclude>commons-io:commons-io:jar</exclude>
                 <exclude>org.apache.geronimo.specs:geronimo-javamail:jar</exclude>
                 <exclude>xml-apis:xml-apis:jar</exclude>
-                <exclude>xerces:xercesImpl:jar</exclude>                
+                <exclude>xerces:xercesImpl:jar</exclude>
             </excludes>
         </dependencySet>
         <dependencySet>
@@ -244,6 +281,6 @@
             </includes>
             <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
         </dependencySet>
-
     </dependencySets>
+  
 </assembly>

Modified: webservices/synapse/trunk/java/src/main/bin/synapse.bat
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/bin/synapse.bat?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/src/main/bin/synapse.bat (original)
+++ webservices/synapse/trunk/java/src/main/bin/synapse.bat Tue Aug  7 21:39:51 2007
@@ -92,27 +92,29 @@
 :runSynapse
 rem set the classes by looping through the libs
 setlocal EnableDelayedExpansion
-set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%/lib"
-FOR %%C in ("%SYNAPSE_HOME%\lib\*.jar") DO set SYNAPSE_CLASS_PATH=!SYNAPSE_CLASS_PATH!;"%%~fC"
-set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%\lib";%SYNAPSE_CLASS_PATH%
+set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%/webapp/WEB-INF/lib"
+FOR %%C in ("%SYNAPSE_HOME%\webapp\WEB-INF\lib\*.jar") DO set SYNAPSE_CLASS_PATH=!SYNAPSE_CLASS_PATH!;"%%~fC"
+set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%\webapp\WEB-INF\lib";%SYNAPSE_CLASS_PATH%
+
+set SYNAPSE_CLASS_PATH="%SYNAPSE_HOME%\webapp\WEB-INF\classes";%SYNAPSE_CLASS_PATH%
 
 rem use proper bouncy castle version for the JDK
 
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.4" >NUL
 IF ERRORLEVEL 1 goto checkJdk15
 echo  Using Bouncy castle JAR for Java 1.4
-FOR %%C in ("%SYNAPSE_HOME%\lib\bcprov-jdk13*.jar") DO set SYNAPSE_CLASS_PATH="%%~fC";!SYNAPSE_CLASS_PATH!
+FOR %%C in ("%SYNAPSE_HOME%\webapp\WEB-INF\lib\bcprov-jdk13*.jar") DO set SYNAPSE_CLASS_PATH="%%~fC";!SYNAPSE_CLASS_PATH!
 goto runServer
 
 :checkJdk15
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.5" >NUL
 IF ERRORLEVEL 1 goto runServer
 echo  Using Bouncy castle JAR for Java 1.5
-FOR %%C in ("%SYNAPSE_HOME%\lib\bcprov-jdk15*.jar") DO set SYNAPSE_CLASS_PATH="%%~fC";!SYNAPSE_CLASS_PATH!
+FOR %%C in ("%SYNAPSE_HOME%\webapp\WEB-INF\lib\bcprov-jdk15*.jar") DO set SYNAPSE_CLASS_PATH="%%~fC";!SYNAPSE_CLASS_PATH!
 
 :runServer
 rem if a sample configuration is not specified, use default
-if "%_SYNAPSE_XML%" == "" set _SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\repository\conf\synapse.xml"
+if "%_SYNAPSE_XML%" == "" set _SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\webapp\WEB-INF\classes\conf\synapse.xml"
 
 set SYNAPSE_ENDORSED="%SYNAPSE_HOME%\lib\endorsed";"%JAVA_ENDORSED_DIRS%";"%JAVA_HOME%\lib\endorsed"
 
@@ -123,7 +125,7 @@
 echo Using JAVA_HOME:       %JAVA_HOME%
 echo Using SYNAPSE_XML:     %_SYNAPSE_XML%
 
-%_JAVACMD% %_PORT% %_SYNAPSE_XML% -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Daxis2.xml="%SYNAPSE_HOME%\repository\conf\axis2.xml" -Djava.endorsed.dirs=%SYNAPSE_ENDORSED% %_XDEBUG% -cp %SYNAPSE_CLASS_PATH% org.apache.synapse.SynapseServer "%SYNAPSE_HOME%\repository"
+%_JAVACMD% %_PORT% %_SYNAPSE_XML% -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Daxis2.xml="%SYNAPSE_HOME%\webapp\WEB-INF\classes\conf\axis2.xml" -Djava.endorsed.dirs=%SYNAPSE_ENDORSED% %_XDEBUG% -cp %SYNAPSE_CLASS_PATH% org.apache.synapse.SynapseServer "%SYNAPSE_HOME%\repository"
 goto end
 
 :end

Modified: webservices/synapse/trunk/java/src/main/bin/synapse.sh
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/src/main/bin/synapse.sh?view=diff&rev=563740&r1=563739&r2=563740
==============================================================================
--- webservices/synapse/trunk/java/src/main/bin/synapse.sh (original)
+++ webservices/synapse/trunk/java/src/main/bin/synapse.sh Tue Aug  7 21:39:51 2007
@@ -84,12 +84,12 @@
 fi
 
 # update classpath
-SYNAPSE_CLASSPATH="$SYNAPSE_HOME/lib"
-for f in $SYNAPSE_HOME/lib/*.jar
+SYNAPSE_CLASSPATH="$SYNAPSE_HOME/webapp/WEB-INF/lib"
+for f in $SYNAPSE_HOME/webapp/WEB-INF/lib/*.jar
 do
   SYNAPSE_CLASSPATH=$SYNAPSE_CLASSPATH:$f
 done
-SYNAPSE_CLASSPATH=$JAVA_HOME/lib/tools.jar:$SYNAPSE_CLASSPATH:$CLASSPATH
+SYNAPSE_CLASSPATH=$SYNAPSE_HOME/webapp/WEB-INF/classes:$JAVA_HOME/lib/tools.jar:$SYNAPSE_CLASSPATH:$CLASSPATH
 
 # use proper bouncy castle version for the JDK
 jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`
@@ -97,13 +97,13 @@
 
 if [ "$jdk_15" ]; then
     echo " Using Bouncy castle JAR for Java 1.5"
-    for f in $SYNAPSE_HOME/lib/bcprov-jdk15*.jar
+    for f in $SYNAPSE_HOME/webapp/WEB-INF/lib/bcprov-jdk15*.jar
     do
       SYNAPSE_CLASSPATH=$f:$SYNAPSE_CLASSPATH
     done
 elif [ "$jdk_14" ]; then
     echo " Using Bouncy castle JAR for Java 1.4"
-    for f in $SYNAPSE_HOME/lib/bcprov-jdk13*.jar
+    for f in $SYNAPSE_HOME/webapp/WEB-INF/lib/bcprov-jdk13*.jar
     do
       SYNAPSE_CLASSPATH=$f:$SYNAPSE_CLASSPATH
     done
@@ -121,7 +121,7 @@
 SYNAPSE_ENDORSED=$SYNAPSE_HOME/lib/endorsed
 
 # synapse.xml
-SYNAPSE_XML=-Dsynapse.xml=$SYNAPSE_HOME/repository/conf/synapse.xml
+SYNAPSE_XML=-Dsynapse.xml=$SYNAPSE_HOME/webapp/WEB-INF/classes/conf/synapse.xml
 
 if [ "$1" = "-xdebug" ]; then
   XDEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
@@ -152,4 +152,4 @@
 echo "Using JAVA_HOME:       $JAVA_HOME"
 echo "Using SYNAPSE_XML:     $SYNAPSE_XML"
 
-$JAVA_HOME/bin/java $XDEBUG $PORT $SYNAPSE_XML -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Daxis2.xml=$SYNAPSE_HOME/repository/conf/axis2.xml -Djava.endorsed.dirs=$SYNAPSE_ENDORSED -classpath $SYNAPSE_CLASSPATH org.apache.synapse.SynapseServer $SYNAPSE_HOME/repository
+$JAVA_HOME/bin/java $XDEBUG $PORT $SYNAPSE_XML -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Daxis2.xml=$SYNAPSE_HOME/webapp/WEB-INF/classes/conf/axis2.xml -Djava.endorsed.dirs=$SYNAPSE_ENDORSED -classpath $SYNAPSE_CLASSPATH org.apache.synapse.SynapseServer $SYNAPSE_HOME/repository



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message