Index: sjc/src/main/resources/logging.properties
===================================================================
--- sjc/src/main/resources/logging.properties	(revision 105709)
+++ sjc/src/main/resources/logging.properties	(working copy)
@@ -23,7 +23,7 @@
 ### $Id: $ ###
 
 # Additional logger names to configure (root logger is always configured)
-loggers=org.jboss.jca,org.jboss,org.jnp,com.arjuna,org.mortbay
+loggers=org.jboss.jca,org.jboss,org.jnp,com.arjuna,org.eclipse.jetty
 
 # Root logger level
 logger.level=${jboss.jca.log.level:INFO}
@@ -41,8 +41,8 @@
 # com.arjuna
 logger.com.arjuna.level=WARN
 
-# org.mortbay
-logger.org.mortbay.level=WARN
+# org.eclipse.jetty
+logger.org.eclipse.jetty.level=WARN
 
 # Console handler configuration
 handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
Index: sjc/src/main/resources/system/web.xml
===================================================================
--- sjc/src/main/resources/system/web.xml	(revision 105709)
+++ sjc/src/main/resources/system/web.xml	(working copy)
@@ -9,7 +9,7 @@
 
   <!-- WAR deployer -->
   <bean name="WARDeployer" class="org.jboss.jca.web.WARDeployer">
-    <property name="server"><inject bean="WebServer" property="Server"/></property>
+    <property name="WebServer"><inject bean="WebServer"/></property>
     <depends>WebServer</depends>
   </bean>
 
Index: build.xml
===================================================================
--- build.xml	(revision 105709)
+++ build.xml	(working copy)
@@ -90,7 +90,7 @@
   <property name="version.arquillian" value="1.0.0.Alpha2"/>
   <property name="version.dom4j" value="1.6.1"/>
   <property name="version.mockito" value="1.8.2"/>
-  <property name="version.eclipse-jdt" value="3.1.1"/>
+  <property name="version.eclipse.ecj" value="3.5.1"/>
   <property name="version.fungal" value="0.8.0.Beta4"/>
   <property name="version.hibernate-validator" value="4.0.2.GA"/>
   <property name="version.javassist" value="3.12.0.GA"/>
@@ -125,8 +125,10 @@
   <property name="version.jboss.vfs" value="2.1.3.SP1"/>
   <property name="version.jboss.xb" value="2.0.1.GA"/>
   <property name="version.jdepend" value="2.9.1"/>
-  <property name="version.jetty" value="6.1.22"/>
+  <property name="version.jetty" value="7.1.3.v20100526"/>
   <property name="version.jetty.servlet" value="6.1.14"/>
+  <property name="version.jetty.glassfish" value="2.1.v20100127"/>
+  <property name="version.jasper" value="glassfish_2.1.0.v201004190952"/>
   <property name="version.junit" value="4.8.1"/>
   <property name="version.slf4j" value="1.5.6"/>
   <property name="version.stax" value="1.0.1"/>
Index: doc/userguide/en/modules/about.xml
===================================================================
--- doc/userguide/en/modules/about.xml	(revision 105709)
+++ doc/userguide/en/modules/about.xml	(working copy)
@@ -24,7 +24,7 @@
     <title>Thanks to</title>
 
     <para>
-      Dimitris Andreadis, Carlo de Wolf, Jason Green, Jonathan Halliday, Vicky Kak,  
+      Dimitris Andreadis, Carlo de Wolf, Jason Green, Jonathan Halliday, Søren Hilmer, Vicky Kak,  
       Sacha Labourey, Alexey Loubyansky, Patrick MacDonald, Andrig Miller,
       Andrew Lee Rubinger, Anil Saldhana and Scott Stark.
     </para>
Index: ivy.xml
===================================================================
--- ivy.xml	(revision 105709)
+++ ivy.xml	(working copy)
@@ -48,8 +48,19 @@
     <dependency org="jdepend" name="jdepend" rev="${version.jdepend}" conf="standalone->default;sjc->*"/>
     <dependency org="junit" name="junit" rev="${version.junit}" conf="test->default"/>
     <dependency org="log4j" name="log4j" rev="${version.apache-log4j}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.apache" name="jasper" rev="${version.jasper}" conf="standalone->default;sjc->*"/>
     <dependency org="org.apache.ant" name="ant" rev="${version.ant}" conf="standalone->default;sjc->*"/>
-    <dependency org="org.eclipse.jdt" name="core" rev="${version.eclipse-jdt}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="${version.eclipse.ecj}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-continuation" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-http" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-io" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-jsp-2.1" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-security" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-server" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-servlet" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-util" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-webapp" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.eclipse.jetty" name="jetty-xml" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
     <dependency org="org.hibernate" name="hibernate-validator" rev="${version.hibernate-validator}" conf="standalone->default;sjc->*"/>
     <dependency org="org.jboss" name="jboss-common-core" rev="${version.jboss.common}" conf="standalone->default;sjc->*"/>
     <dependency org="org.jboss" name="jboss-mdr" rev="${version.jboss.mdr}" conf="standalone->default;sjc->*"/>
@@ -104,11 +115,7 @@
     <dependency org="org.jboss.stdio" name="jboss-stdio" rev="${version.jboss.stdio}" conf="standalone->default;sjc->*"/>
     <dependency org="org.jboss.threads" name="jboss-threads" rev="${version.jboss.threads}" conf="standalone->default;sjc->*"/>
     <dependency org="org.jboss.threads" name="jboss-threads-metadata" rev="${version.jboss.threads}" conf="standalone->default"/>
-    <dependency org="org.mockito" name="mockito-all" rev="${version.mockito}" conf="test->default"/>
-    <dependency org="org.mortbay.jetty" name="jetty" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
-    <dependency org="org.mortbay.jetty" name="jetty-util" rev="${version.jetty}" conf="standalone->default;sjc->*"/>
-    <dependency org="org.mortbay.jetty" name="jsp-2.1" rev="${version.jetty.servlet}" conf="standalone->default;sjc->*"/>
-    <dependency org="org.mortbay.jetty" name="jsp-api-2.1" rev="${version.jetty.servlet}" conf="standalone->default;sjc->*"/>
+    <dependency org="org.mortbay.jetty" name="jsp-api-2.1-glassfish"  rev="${version.jetty.glassfish}" conf="standalone->default;sjc->*"/>
     <dependency org="org.mortbay.jetty" name="servlet-api-2.5" rev="${version.jetty.servlet}" conf="standalone->default;sjc->*"/>
     <dependency org="org.slf4j" name="jcl-over-slf4j" rev="${version.slf4j}" conf="standalone->default;sjc->*"/>
     <dependency org="org.slf4j" name="slf4j-api" rev="${version.slf4j}" conf="standalone->default;sjc->*"/>
Index: web/src/main/java/org/jboss/jca/web/ExecutorThreadPool.java
===================================================================
--- web/src/main/java/org/jboss/jca/web/ExecutorThreadPool.java	(revision 105709)
+++ web/src/main/java/org/jboss/jca/web/ExecutorThreadPool.java	(working copy)
@@ -29,8 +29,8 @@
 
 import org.jboss.logging.Logger;
 
-import org.mortbay.component.AbstractLifeCycle;
-import org.mortbay.thread.ThreadPool;
+import org.eclipse.jetty.util.component.AbstractLifeCycle;
+import org.eclipse.jetty.util.thread.ThreadPool;
 
 /**
  * An implementation of the Jetty ThreadPool interface using an ExecutorService
Index: web/src/main/java/org/jboss/jca/web/WebServer.java
===================================================================
--- web/src/main/java/org/jboss/jca/web/WebServer.java	(revision 105709)
+++ web/src/main/java/org/jboss/jca/web/WebServer.java	(working copy)
@@ -26,15 +26,19 @@
 
 import org.jboss.logging.Logger;
 
-import org.mortbay.jetty.Connector;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.bio.SocketConnector;
+import com.github.fungal.spi.deployers.DeployerPhases;
 
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.bio.SocketConnector;
+import org.eclipse.jetty.server.handler.HandlerList;
+
 /**
  * The web server
  * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
  */
-public class WebServer
+public class WebServer implements DeployerPhases
 {
    private static Logger log = Logger.getLogger(WebServer.class);
    private static boolean trace = log.isTraceEnabled();
@@ -51,6 +55,9 @@
    /** Executor service */
    private ExecutorService executorService;
 
+    /** Handlers for web apps **/
+   private HandlerList handlers;
+
    /**
     * Constructs the web server
     */
@@ -60,27 +67,10 @@
       this.host = "localhost";
       this.port = 8080;
       this.executorService = null;
+      this.handlers = new HandlerList();
    }
 
    /**
-    * Get the web server
-    * @return The server
-    */
-   public Server getServer()
-   {
-      return server;
-   }
-
-   /**
-    * Get the host
-    * @return The host
-    */
-   public String getHost()
-   {
-      return host;
-   }
-
-   /**
     * Set the host
     * @param host The host
     */
@@ -135,8 +125,6 @@
       if (executorService != null)
          server.setThreadPool(new ExecutorThreadPool(executorService));
 
-      server.start();
-
       log.info("Jetty " + Server.getVersion() + " started");
    }
 
@@ -149,8 +137,61 @@
       if (server != null && server.isRunning())
       {
          server.stop();
+         handlers = new HandlerList();
 
          log.info("Jetty " + Server.getVersion() + " stopped");
       }
    }
+
+   /**
+    * Pre deploy
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void preDeploy() throws Throwable
+   {
+   }
+
+   /**
+    * Post deploy
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void postDeploy() throws Throwable
+   {
+      try
+      {
+         server.setHandler(handlers);
+      
+         server.start();
+      }
+      catch (Exception e)
+      {
+         log.error("Could not start Jetty webserver");
+      }
+   }
+
+   /**
+    * Pre undeploy
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void preUndeploy() throws Throwable
+   {
+   }
+
+   /**
+    * Post undeploy
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void postUndeploy() throws Throwable
+   {
+   }
+
+   /**
+    * Add a handle
+    * @param handler The handle
+    */
+   void addHandler(Handler handler)
+   {
+      handler.setServer(server);
+      handlers.addHandler(handler);
+   }
 }
Index: web/src/main/java/org/jboss/jca/web/WARDeployment.java
===================================================================
--- web/src/main/java/org/jboss/jca/web/WARDeployment.java	(revision 105709)
+++ web/src/main/java/org/jboss/jca/web/WARDeployment.java	(working copy)
@@ -32,7 +32,7 @@
 import com.github.fungal.api.util.FileUtil;
 import com.github.fungal.spi.deployers.Deployment;
 
-import org.mortbay.jetty.Handler;
+import org.eclipse.jetty.server.Handler;
 
 /**
  * A web archive deployment for JCA/SJC
@@ -100,7 +100,7 @@
          {
             handler.stop();
          }
-         catch (Exception e)
+         catch (Throwable t)
          {
             // Ignore
          }
Index: web/src/main/java/org/jboss/jca/web/WARDeployer.java
===================================================================
--- web/src/main/java/org/jboss/jca/web/WARDeployer.java	(revision 105709)
+++ web/src/main/java/org/jboss/jca/web/WARDeployer.java	(working copy)
@@ -32,11 +32,8 @@
 import com.github.fungal.spi.deployers.DeployException;
 import com.github.fungal.spi.deployers.Deployer;
 import com.github.fungal.spi.deployers.Deployment;
+import org.eclipse.jetty.webapp.WebAppContext;
 
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.webapp.WebAppContext;
-
-
 /**
  * The WAR deployer for JCA/SJC
  * @author <a href="mailto:jesper.pedersen@jboss.org">Jesper Pedersen</a>
@@ -46,32 +43,32 @@
    private static Logger log = Logger.getLogger(WARDeployer.class);
    private static boolean trace = log.isTraceEnabled();
 
-   private Server server;
-   
+   private WebServer webServer;
+       
    /**
     * Constructor
     */
    public WARDeployer()
    {
-      this.server = null;
+      this.webServer = null;
    }
 
    /**
-    * Get the server
+    * Get the web server
     * @return The server
     */
-   public Server getServer()
+   public WebServer getWebServer()
    {
-      return server;
+      return webServer;
    }
 
    /**
-    * Set the server
+    * Set the web server
     * @param server The server
     */
-   public void setServer(Server server)
+   public void setWebServer(WebServer server)
    {
-      this.server = server;
+      this.webServer = server;
    }
 
    /**
@@ -148,14 +145,11 @@
          log.debug("ContextPath=" + contextPath);
 
          WebAppContext webapp = new WebAppContext();
-         webapp.setServer(server);
          webapp.setContextPath(contextPath);
          webapp.setWar(url.toString());
-         webapp.setTempDirectory(tmpDeployment); 
+         webapp.setTempDirectory(tmpDeployment);
 
-         server.stop();
-         server.addHandler(webapp);
-         server.start();
+         webServer.addHandler(webapp);
 
          log.info("Deployed: " + url.toExternalForm());
 
Index: web/src/main/resources/web.xml
===================================================================
--- web/src/main/resources/web.xml	(revision 105709)
+++ web/src/main/resources/web.xml	(working copy)
@@ -9,7 +9,7 @@
 
   <!-- WAR deployer -->
   <bean name="WARDeployer" class="org.jboss.jca.web.WARDeployer">
-    <property name="server"><inject bean="WebServer" property="Server"/></property>
+    <property name="WebServer"><inject bean="WebServer"/></property>
     <depends>WebServer</depends>
   </bean>
 
