Upgrades HtmlUnit and it dependencies

Some major upgrades:
  /htmlunit
  /jetty
  /apache/commons
  /apache/http
  /xerces
  /tomcat/servlet-api

Fixes issue 7224

Change-Id: I36cc569c2926aa59ee7375e719b917d6d3681a43
Review-Link: https://gwt-review.googlesource.com/#/c/4323/
diff --git a/dev/build.xml b/dev/build.xml
index a301c4e..7c3219b 100755
--- a/dev/build.xml
+++ b/dev/build.xml
@@ -60,7 +60,8 @@
           <include name="eclipse/jdtCompilerAdapter-3.8.3.v20130121-145325.jar" />
           <include name="guava/guava-15.0/guava-15.0-rebased.jar" />
           <include name="icu4j/50.1.1/icu4j.jar" />
-          <include name="jetty/jetty-6.1.11.jar" />
+          <include name="jetty/jetty-8.1.12.v20130726/jetty-8.1.12.v20130726.jar" />
+          <include name="jetty/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar" />
           <include name="jscomp/20131014/compiler-rebased.jar" />
           <include name="jscomp/20131014/sourcemap-rebased.jar" />
           <include name="jsr305/jsr305.jar" />
@@ -73,23 +74,23 @@
           <!-- dependencies needed for JSP support in DevMode: END -->
           <include name="apache/commons/commons-collections-3.2.1.jar" />
           <!-- htmlunit dependencies not already included: BEGIN -->
-          <include name="apache/http/httpclient-4.1.2.jar" />
-          <include name="apache/http/httpcore-4.1.2.jar" />
-          <include name="apache/http/httpmime-4.1.2.jar" />
+          <include name="apache/http/httpclient-4.3.1.jar" />
+          <include name="apache/http/httpcore-4.3.jar" />
+          <include name="apache/http/httpmime-4.3.1.jar" />
           <include name="apache/james/apache-mime4j-0.6.jar" />
-          <include name="apache/commons/commons-codec-1.3.jar" />
-          <include name="apache/commons/commons-io-1.4.jar" />
-          <include name="apache/commons/commons-lang-2.6.jar" />
-          <include name="apache/commons/commons-logging-1.1.1.jar" />
-          <include name="cssparser/cssparser-0.9.5.jar" />
-          <include name="htmlunit/htmlunit-2.9/htmlunit-v2.9.jar" />
-          <include name="htmlunit/htmlunit-2.9/htmlunit-core-js-v2.9.jar" />
-          <include name="nekohtml/nekohtml-1.9.15.jar" />
+          <include name="apache/commons/commons-codec-1.8.jar" />
+          <include name="apache/commons/commons-io-2.4.jar" />
+          <include name="apache/commons/commons-lang3-3.1.jar" />
+          <include name="apache/commons/commons-logging-1.1.3.jar" />
+          <include name="cssparser/cssparser-0.9.11.jar" />
+          <include name="htmlunit/htmlunit-2.13/htmlunit-2.13.jar" />
+          <include name="htmlunit/htmlunit-2.13/htmlunit-core-js-2.13.jar" />
+          <include name="nekohtml/nekohtml-1.9.19.jar" />
           <include name="cup/java-cup-11a.jar" />
           <include name="xalan/xalan-2.7.1-nocup.jar" />
-          <include name="xerces/xerces-2_9_1/serializer.jar" />
-          <include name="xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar" />
-          <include name="xerces/xerces-2_9_1/xml-apis.jar" />
+          <include name="xerces/xerces-2_11_0/serializer-2.7.1.jar" />
+          <include name="xerces/xerces-2_11_0/xercesImpl-2.11.0.jar" />
+          <include name="xerces/xerces-2_11_0/xml-apis-1.4.01.jar" />
           <include name="w3c/sac/sac-1.3.jar" />
           <!-- htmlunit dependencies not already included: END -->
           <include name="sun/swingworker/swing-worker-1.1.jar" />
@@ -110,7 +111,8 @@
           <zipfileset src="${gwt.tools.lib}/eclipse/jdtCompilerAdapter-3.8.3.v20130121-145325.jar" />
           <zipfileset src="${gwt.tools.lib}/guava/guava-15.0/guava-15.0-rebased.jar" />
           <zipfileset src="${gwt.tools.lib}/icu4j/50.1.1/icu4j.jar" />
-          <zipfileset src="${gwt.tools.lib}/jetty/jetty-6.1.11.jar" />
+          <zipfileset src="${gwt.tools.lib}/jetty/jetty-8.1.12.v20130726/jetty-8.1.12.v20130726.jar" />
+          <zipfileset src="${gwt.tools.lib}/jetty/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar" />
           <zipfileset src="${gwt.tools.lib}/jscomp/20131014/compiler-rebased.jar" />
           <zipfileset src="${gwt.tools.lib}/jscomp/20131014/sourcemap-rebased.jar" />
           <zipfileset src="${gwt.tools.lib}/jsr305/jsr305.jar" />
@@ -123,23 +125,23 @@
           <!-- dependencies needed for JSP support in DevMode: END -->
           <zipfileset src="${gwt.tools.lib}/apache/commons/commons-collections-3.2.1.jar" />
           <!-- htmlunit dependencies not already included: BEGIN -->
-          <zipfileset src="${gwt.tools.lib}/apache/http/httpclient-4.1.2.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/http/httpcore-4.1.2.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/http/httpmime-4.1.2.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/http/httpclient-4.3.1.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/http/httpcore-4.3.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/http/httpmime-4.3.1.jar" />
           <zipfileset src="${gwt.tools.lib}/apache/james/apache-mime4j-0.6.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-codec-1.3.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-io-1.4.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-lang-2.6.jar" />
-          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-logging-1.1.1.jar" />
-          <zipfileset src="${gwt.tools.lib}/cssparser/cssparser-0.9.5.jar" />
-          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-2.9/htmlunit-2.9.jar" />
-          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-2.9/htmlunit-core-js-2.9.jar" />
-          <zipfileset src="${gwt.tools.lib}/nekohtml/nekohtml-1.9.15.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-codec-1.8.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-io-2.4.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-lang3-3.1.jar" />
+          <zipfileset src="${gwt.tools.lib}/apache/commons/commons-logging-1.1.3.jar" />
+          <zipfileset src="${gwt.tools.lib}/cssparser/cssparser-0.9.11.jar" />
+          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-2.13/htmlunit-2.13.jar" />
+          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-2.13/htmlunit-core-js-2.13.jar" />
+          <zipfileset src="${gwt.tools.lib}/nekohtml/nekohtml-1.9.19.jar" />
           <zipfileset src="${gwt.tools.lib}/cup/java-cup-11a.jar" />
           <zipfileset src="${gwt.tools.lib}/xalan/xalan-2.7.1-nocup.jar" />
-          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_9_1/serializer.jar" />
-          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar" />
-          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_9_1/xml-apis.jar" />
+          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_11_0/serializer-2.7.1.jar" />
+          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_11_0/xercesImpl-2.11.0.jar" />
+          <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_11_0/xml-apis-1.4.01.jar" />
           <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
           <!-- htmlunit dependencies not already included: END -->
           <zipfileset src="${gwt.tools.lib}/sun/swingworker/swing-worker-1.1.jar" />
diff --git a/dev/codeserver/build.xml b/dev/codeserver/build.xml
index 52af07f..3c523e4 100755
--- a/dev/codeserver/build.xml
+++ b/dev/codeserver/build.xml
@@ -22,8 +22,8 @@
         <include name="**/*.java"/>
       </fileset>
     </copy>
-    <replace dir="${src}" token="com.google.gwt.thirdparty.org.mortbay."
-             value="org.mortbay."/>
+    <replace dir="${src}" token="com.google.gwt.thirdparty.org.eclipse.jetty."
+             value="org.eclipse.jetty."/>
   </target>
 
   <target name="compile" depends="preprocess">
diff --git a/dev/codeserver/java/com/google/gwt/dev/codeserver/WebServer.java b/dev/codeserver/java/com/google/gwt/dev/codeserver/WebServer.java
index d443ea9..6699312 100644
--- a/dev/codeserver/java/com/google/gwt/dev/codeserver/WebServer.java
+++ b/dev/codeserver/java/com/google/gwt/dev/codeserver/WebServer.java
@@ -20,17 +20,16 @@
 import com.google.gwt.core.ext.UnableToCompleteException;
 import com.google.gwt.dev.json.JsonArray;
 import com.google.gwt.dev.json.JsonObject;
-import com.google.gwt.thirdparty.org.mortbay.io.Buffer;
-import com.google.gwt.thirdparty.org.mortbay.jetty.HttpConnection;
-import com.google.gwt.thirdparty.org.mortbay.jetty.MimeTypes;
-import com.google.gwt.thirdparty.org.mortbay.jetty.Request;
-import com.google.gwt.thirdparty.org.mortbay.jetty.Server;
-import com.google.gwt.thirdparty.org.mortbay.jetty.handler.AbstractHandler;
-import com.google.gwt.thirdparty.org.mortbay.jetty.nio.SelectChannelConnector;
-import com.google.gwt.thirdparty.org.mortbay.jetty.servlet.FilterHolder;
-import com.google.gwt.thirdparty.org.mortbay.jetty.servlet.ServletHandler;
-import com.google.gwt.thirdparty.org.mortbay.jetty.servlet.ServletHolder;
-import com.google.gwt.thirdparty.org.mortbay.servlet.GzipFilter;
+import com.google.gwt.thirdparty.org.eclipse.jetty.http.MimeTypes;
+import com.google.gwt.thirdparty.org.eclipse.jetty.io.Buffer;
+import com.google.gwt.thirdparty.org.eclipse.jetty.server.AbstractHttpConnection;
+import com.google.gwt.thirdparty.org.eclipse.jetty.server.Request;
+import com.google.gwt.thirdparty.org.eclipse.jetty.server.Server;
+import com.google.gwt.thirdparty.org.eclipse.jetty.server.nio.SelectChannelConnector;
+import com.google.gwt.thirdparty.org.eclipse.jetty.servlet.FilterHolder;
+import com.google.gwt.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler;
+import com.google.gwt.thirdparty.org.eclipse.jetty.servlet.ServletHolder;
+import com.google.gwt.thirdparty.org.eclipse.jetty.servlets.GzipFilter;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -39,12 +38,14 @@
 import java.io.InputStream;
 import java.io.PrintWriter;
 import java.util.Date;
+import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 import javax.servlet.ServletException;
+import javax.servlet.DispatcherType;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -115,17 +116,17 @@
     Server server = new Server();
     server.addConnector(connector);
 
-    ServletHandler servletHandler = new ServletHandler();
-    servletHandler.addServletWithMapping(new ServletHolder(new HttpServlet() {
+    ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+    handler.setContextPath("/");
+    handler.addServlet(new ServletHolder(new HttpServlet() {
       @Override
       protected void doGet(HttpServletRequest request, HttpServletResponse response)
           throws ServletException, IOException {
         handleRequest(request.getPathInfo(), request, response);
       }
     }), "/*");
-    servletHandler.addFilterWithMapping(new FilterHolder(GzipFilter.class),
-        "/*", AbstractHandler.DEFAULT);
-    server.addHandler(servletHandler);
+    handler.addFilter(GzipFilter.class, "/*", EnumSet.allOf(DispatcherType.class));
+    server.setHandler(handler);
     try {
       server.start();
     } catch (Exception e) {
@@ -505,7 +506,7 @@
 
   private static void setHandled(HttpServletRequest request) {
     Request baseRequest = (request instanceof Request) ? (Request) request :
-        HttpConnection.getCurrentConnection().getRequest();
+        AbstractHttpConnection.getCurrentConnection().getRequest();
     baseRequest.setHandled(true);
   }
 }
diff --git a/dev/core/src/com/google/gwt/dev/shell/HtmlUnitSessionHandler.java b/dev/core/src/com/google/gwt/dev/shell/HtmlUnitSessionHandler.java
index 4b6942b..f391985 100644
--- a/dev/core/src/com/google/gwt/dev/shell/HtmlUnitSessionHandler.java
+++ b/dev/core/src/com/google/gwt/dev/shell/HtmlUnitSessionHandler.java
@@ -32,6 +32,7 @@
 import com.gargoylesoftware.htmlunit.javascript.SimpleScriptableProxy;
 import com.gargoylesoftware.htmlunit.javascript.host.Window;
 
+import net.sourceforge.htmlunit.corejs.javascript.ConsString;
 import net.sourceforge.htmlunit.corejs.javascript.Context;
 import net.sourceforge.htmlunit.corejs.javascript.Function;
 import net.sourceforge.htmlunit.corejs.javascript.JavaScriptException;
@@ -210,7 +211,7 @@
       if (args.length == 1
           && methodName.indexOf(REPLACE_METHOD_SIGNATURE) != -1) {
         // getUrl() is not visible
-        String currentUrl = window.jsxGet_location().toString();
+        String currentUrl = window.getLocation().toString();
         currentUrl = getUrlBeforeHash(currentUrl);
         String newUrl = getUrlBeforeHash((String) args[0].getValue());
         if (!newUrl.equals(currentUrl)) {
@@ -303,6 +304,9 @@
       returnVal.setJsObject(new JsObjectRef(refId));
       return returnVal;
     }
+    if (value instanceof ConsString) {
+      return new Value(value.toString());
+    }
     if (value instanceof Number) {
       return new Value(convertNumberFromJsval(((Number) value)));
     }
diff --git a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java b/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
index b282825..7e4e3ee 100644
--- a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
+++ b/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java
@@ -24,20 +24,22 @@
 
 import org.apache.tools.ant.taskdefs.Javac;
 import org.eclipse.jdt.core.JDTCompilerAdapter;
-import org.mortbay.component.AbstractLifeCycle;
-import org.mortbay.jetty.AbstractConnector;
-import org.mortbay.jetty.HttpFields.Field;
-import org.mortbay.jetty.Request;
-import org.mortbay.jetty.RequestLog;
-import org.mortbay.jetty.Response;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.RequestLogHandler;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.security.SslSocketConnector;
-import org.mortbay.jetty.webapp.WebAppClassLoader;
-import org.mortbay.jetty.webapp.WebAppContext;
-import org.mortbay.log.Log;
-import org.mortbay.log.Logger;
+import org.eclipse.jetty.http.HttpFields;
+import org.eclipse.jetty.http.HttpFields.Field;
+import org.eclipse.jetty.server.AbstractConnector;
+import org.eclipse.jetty.server.AbstractHttpConnection;
+import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.RequestLog;
+import org.eclipse.jetty.server.Response;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.RequestLogHandler;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.util.component.AbstractLifeCycle;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
+import org.eclipse.jetty.webapp.WebAppClassLoader;
+import org.eclipse.jetty.webapp.WebAppContext;
 
 import java.io.File;
 import java.io.IOException;
@@ -46,7 +48,6 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.Iterator;
 
 import javax.imageio.ImageIO;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -139,25 +140,21 @@
             + " - " + request.getMethod() + ' ' + request.getUri() + " ("
             + userString + request.getRemoteHost() + ')' + bytesString);
         if (branch.isLoggable(logHeaders)) {
-          // Request headers
-          TreeLogger headers = branch.branch(logHeaders, "Request headers");
-          Iterator<Field> headerFields = request.getConnection().getRequestFields().getFields();
-          while (headerFields.hasNext()) {
-            Field headerField = headerFields.next();
-            headers.log(logHeaders, headerField.getName() + ": "
-                + headerField.getValue());
-          }
-          // Response headers
-          headers = branch.branch(logHeaders, "Response headers");
-          headerFields = response.getHttpFields().getFields();
-          while (headerFields.hasNext()) {
-            Field headerField = headerFields.next();
-            headers.log(logHeaders, headerField.getName() + ": "
-                + headerField.getValue());
-          }
+          AbstractHttpConnection connection = request.getConnection();
+          logHeaders(branch.branch(logHeaders, "Request headers"), logHeaders,
+              connection.getRequestFields());
+          logHeaders(branch.branch(logHeaders, "Response headers"), logHeaders,
+              connection.getResponseFields());
         }
       }
     }
+
+    private void logHeaders(TreeLogger logger, TreeLogger.Type logLevel, HttpFields fields) {
+      for (int i = 0; i < fields.size(); ++i) {
+        Field field = fields.getField(i);
+        logger.log(logLevel, field.getName() + ": " + field.getValue());
+      }
+    }
   }
 
   /**
@@ -178,9 +175,9 @@
       this.logger = logger;
     }
 
-    public void debug(String msg, Object arg0, Object arg1) {
+    public void debug(String msg, Object... args) {
       if (logger.isLoggable(TreeLogger.SPAM)) {
-        logger.log(TreeLogger.SPAM, format(msg, arg0, arg1));
+        logger.log(TreeLogger.SPAM, format(msg, args));
       }
     }
 
@@ -188,16 +185,32 @@
       logger.log(TreeLogger.SPAM, msg, th);
     }
 
+    public void debug(Throwable th) {
+      logger.log(TreeLogger.SPAM, "", th);
+    }
+
     public Logger getLogger(String name) {
       return this;
     }
 
-    public void info(String msg, Object arg0, Object arg1) {
+    public String getName() {
+      return "";
+    }
+
+    public void info(String msg, Object... args) {
       if (logger.isLoggable(TreeLogger.TRACE)) {
-        logger.log(TreeLogger.TRACE, format(msg, arg0, arg1));
+        logger.log(TreeLogger.TRACE, format(msg, args));
       }
     }
 
+    public void info(String msg, Throwable th) {
+      logger.log(TreeLogger.TRACE, msg, th);
+    }
+
+    public void info(Throwable th) {
+      logger.log(TreeLogger.TRACE, "", th);
+    }
+
     public boolean isDebugEnabled() {
       return logger.isLoggable(TreeLogger.SPAM);
     }
@@ -206,9 +219,9 @@
       // ignored
     }
 
-    public void warn(String msg, Object arg0, Object arg1) {
+    public void warn(String msg, Object... args) {
       if (logger.isLoggable(TreeLogger.WARN)) {
-        logger.log(TreeLogger.WARN, format(msg, arg0, arg1));
+        logger.log(TreeLogger.WARN, format(msg, args));
       }
     }
 
@@ -216,20 +229,42 @@
       logger.log(TreeLogger.WARN, msg, th);
     }
 
-    /**
-     * Copied from org.mortbay.log.StdErrLog.
-     */
-    private String format(String msg, Object arg0, Object arg1) {
-      int i0 = msg.indexOf("{}");
-      int i1 = i0 < 0 ? -1 : msg.indexOf("{}", i0 + 2);
+    public void warn(Throwable th) {
+      logger.log(TreeLogger.WARN, "", th);
+    }
 
-      if (arg1 != null && i1 >= 0) {
-        msg = msg.substring(0, i1) + arg1 + msg.substring(i1 + 2);
+    public void ignore(Throwable th) {
+      logger.log(TreeLogger.SPAM, "IGNORE", th);
+    }
+
+    /**
+     * Copied from org.eclipse.log.StdErrLog.
+     */
+    private String format(String msg, Object... args) {
+      if (msg == null) {
+        msg = "";
+        for (int i = 0; i < args.length; i++) {
+          msg += "{} ";
+        }
       }
-      if (arg0 != null && i0 >= 0) {
-        msg = msg.substring(0, i0) + arg0 + msg.substring(i0 + 2);
+      String braces = "{}";
+      int start = 0;
+      StringBuilder builder = new StringBuilder();
+      for (Object arg : args) {
+        int bracesIndex = msg.indexOf(braces, start);
+        if (bracesIndex < 0) {
+          builder.append(msg.substring(start));
+          builder.append(" ");
+          builder.append(arg);
+          start = msg.length();
+        } else {
+          builder.append(msg.substring(start, bracesIndex));
+          builder.append(String.valueOf(arg));
+          start = bracesIndex + braces.length();
+        }
       }
-      return msg;
+      builder.append(msg.substring(start));
+      return builder.toString();
     }
   }
 
@@ -335,7 +370,7 @@
 
         // For a system path, load from the outside world.
         URL found;
-        if (isSystemPath(checkName)) {
+        if (isSystemClass(checkName.replace('/', '.'))) {
           found = systemClassLoader.getResource(name);
           if (found != null) {
             return found;
@@ -364,23 +399,10 @@
         return super.findResource(name);
       }
 
-      /**
-       * Override to additionally consider the most commonly available JSP and
-       * XML implementation as system resources. (In fact, Jasper is in gwt-dev
-       * via embedded Tomcat, so we always hit this case.)
-       */
-      @Override
-      public boolean isSystemPath(String name) {
-        name = name.replace('/', '.');
-        return super.isSystemPath(name)
-            || name.startsWith("org.apache.jasper.")
-            || name.startsWith("org.apache.xerces.");
-      }
-
       @Override
       protected Class<?> findClass(String name) throws ClassNotFoundException {
         // For system path, always prefer the outside world.
-        if (isSystemPath(name)) {
+        if (isSystemClass(name)) {
           try {
             return systemClassLoader.loadClass(name);
           } catch (ClassNotFoundException e) {
@@ -391,7 +413,7 @@
           return super.findClass(name);
         } catch (ClassNotFoundException e) {
           // Don't allow server classes to be loaded from the outside.
-          if (isServerPath(name)) {
+          if (isServerClass(name)) {
             throw e;
           }
         }
@@ -464,8 +486,6 @@
      */
     private final ClassLoader systemClassLoader = Thread.currentThread().getContextClassLoader();
 
-    private WebAppClassLoaderExtension classLoader;
-
     @SuppressWarnings("unchecked")
     private WebAppContextWithReload(TreeLogger logger, String webApp,
         String contextPath) {
@@ -474,16 +494,27 @@
 
       // Prevent file locking on Windows; pick up file changes.
       getInitParams().put(
-          "org.mortbay.jetty.servlet.Default.useFileMappedBuffer", "false");
+          "org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
 
       // Since the parent class loader is bootstrap-only, prefer it first.
       setParentLoaderPriority(true);
     }
 
+    /**
+     * Override to additionally consider the most commonly available JSP and
+     * XML implementation as system resources. (In fact, Jasper is in gwt-dev
+     * via embedded Tomcat, so we always hit this case.)
+     */
+    @Override
+    public boolean isSystemClass(String name) {
+      return super.isSystemClass(name)
+          || name.startsWith("org.apache.jasper.")
+          || name.startsWith("org.apache.xerces.");
+    }
+
     @Override
     protected void doStart() throws Exception {
-      classLoader = new WebAppClassLoaderExtension();
-      setClassLoader(classLoader);
+      setClassLoader(new WebAppClassLoaderExtension());
       super.doStart();
     }
 
@@ -491,12 +522,12 @@
     protected void doStop() throws Exception {
       super.doStop();
       
-      Class<?> jdbcUnloader = classLoader.loadClass("com.google.gwt.dev.shell.jetty.JDBCUnloader");
+      Class<?> jdbcUnloader =
+          getClassLoader().loadClass("com.google.gwt.dev.shell.jetty.JDBCUnloader");
       java.lang.reflect.Method unload = jdbcUnloader.getMethod("unload");
       unload.invoke(null);
       
       setClassLoader(null);
-      classLoader.destroy();
     }
   }
 
@@ -516,10 +547,6 @@
   private static final String PROPERTY_NOWARN_WEBAPP_CLASSPATH = "gwt.nowarn.webapp.classpath";
 
   static {
-    // Suppress spammy Jetty log initialization.
-    System.setProperty("org.mortbay.log.class", JettyNullLogger.class.getName());
-    Log.getLog();
-
     /*
      * Make JDT the default Ant compiler so that JSP compilation just works
      * out-of-the-box. If we don't set this, it's very, very difficult to make
@@ -672,7 +699,7 @@
     jreLeakPrevention(logger);
     
     // Turn off XML validation.
-    System.setProperty("org.mortbay.xml.XmlParser.Validating", "false");
+    System.setProperty("org.eclipse.jetty.xml.XmlParser.Validating", "false");
 
     Server server = new Server();
 
@@ -704,7 +731,6 @@
         branch.log(TreeLogger.TRACE, "Connection is null");
       }
     }
-
     return createServletContainer(logger, appRootDir, server, wac,
         connectorPort);
   }
@@ -715,8 +741,7 @@
   }
 
   protected WebAppContext createWebAppContext(TreeLogger logger, File appRootDir) {
-    return new WebAppContextWithReload(logger, appRootDir.getAbsolutePath(),
-        "/");
+    return new WebAppContextWithReload(logger, appRootDir.getAbsolutePath(), "/");
   }
 
   protected AbstractConnector getConnector(TreeLogger logger) {
diff --git a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyNullLogger.java b/dev/core/src/com/google/gwt/dev/shell/jetty/JettyNullLogger.java
deleted file mode 100644
index 81418ad..0000000
--- a/dev/core/src/com/google/gwt/dev/shell/jetty/JettyNullLogger.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2009 Google Inc.
- * 
- * Licensed 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 com.google.gwt.dev.shell.jetty;
-
-import org.mortbay.log.Logger;
-
-/**
- * A Jetty {@link Logger} that suppresses all output.
- */
-public class JettyNullLogger implements Logger {
-
-  public void debug(String msg, Throwable th) {
-  }
-
-  public void debug(String msg, Object arg0, Object arg1) {
-  }
-
-  public Logger getLogger(String name) {
-    return this;
-  }
-
-  public void info(String msg, Object arg0, Object arg1) {
-  }
-
-  public boolean isDebugEnabled() {
-    return false;
-  }
-
-  public void setDebugEnabled(boolean enabled) {
-  }
-
-  public void warn(String msg, Throwable th) {
-  }
-
-  public void warn(String msg, Object arg0, Object arg1) {
-  }
-}
diff --git a/eclipse/user/.classpath b/eclipse/user/.classpath
index c857194..b168113 100644
--- a/eclipse/user/.classpath
+++ b/eclipse/user/.classpath
@@ -8,25 +8,25 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2.jar" sourcepath="/GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2-src.zip"/>
 	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/junit/junit-4.8.2.jar" sourcepath="/GWT_TOOLS/lib/junit/junit-4.8.2-src.jar"/>
-	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/tomcat/servlet-api-2.5.jar"/>
-  <classpathentry kind="var" path="GWT_TOOLS/lib/jsr305/jsr305.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpclient-4.1.2.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpcore-4.1.2.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpmime-4.1.2.jar"/>
+	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/jsr305/jsr305.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpclient-4.3.1.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpcore-4.3.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/http/httpmime-4.3.1.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/james/apache-mime4j-0.6.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-codec-1.3.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-codec-1.8.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/commons-collections-3.1.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-lang-2.6.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/commons-logging-1.0.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-io-1.4.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/cssparser/cssparser-0.9.5.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/nekohtml/nekohtml-1.9.15.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-lang3-3.1.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-logging-1.1.1.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-io-2.4.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/cssparser/cssparser-0.9.11.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/nekohtml/nekohtml-1.9.19.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/selenium/selenium-java-client-driver.jar" sourcepath="/GWT_TOOLS/lib/selenium/selenium-java-client-driver-sources.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/cup/java-cup-11a.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/xalan/xalan-2.7.1-nocup.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_9_1/serializer.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_9_1/xercesImpl-NoMetaInf.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_9_1/xml-apis.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_11_0/serializer-2.7.1.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_11_0/xercesImpl-2.11.0.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xerces-2_11_0/xml-apis-1.4.01.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/w3c/sac/sac-1.3.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/w3c/flute/flute-1.3-gg2.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/cglib/cglib-2.2.jar"/>
@@ -34,12 +34,12 @@
 	<classpathentry kind="var" path="GWT_TOOLS/lib/easymock/easymock-3.0.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/objectweb/asm-3.1.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/gwt-dev"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-2.9/htmlunit-2.9.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-2.9/htmlunit-2.9-sources.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-2.9/htmlunit-core-js-2.9.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-2.9/htmlunit-core-js-2.9-sources.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-2.13/htmlunit-2.13.jar" />
+	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-2.13/htmlunit-core-js-2.13.jar" />
 	<classpathentry kind="var" path="GWT_TOOLS/redist/json/r2_20080312/json-1.5.jar" sourcepath="/GWT_TOOLS/redist/json/r2_20080312/json-src.jar"/>
 	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/javax/validation/validation-api-1.0.0.GA.jar" sourcepath="/GWT_TOOLS/lib/javax/validation/validation-api-1.0.0.GA-sources.jar"/>
 	<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/javax/validation/validation-api-1.0.0.GA-sources.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/jetty/jetty-6.1.11.jar" sourcepath="/GWT_TOOLS/lib/jetty/jetty-6.1.11-src.zip"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/jetty/jetty-8.1.12.v20130726/jetty-8.1.12.v20130726.jar" />
 	<classpathentry kind="var" path="GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final.jar" sourcepath="/GWT_TOOLS/lib/hibernate/validator/hibernate-validator-4.1.0.Final-sources.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/apache/log4j/log4j-1.2.16.jar"/>
diff --git a/requestfactory/build.xml b/requestfactory/build.xml
index 2da2feb..40ea109 100755
--- a/requestfactory/build.xml
+++ b/requestfactory/build.xml
@@ -132,7 +132,7 @@
       classname="com.google.web.bindery.requestfactory.vm.RequestFactoryJreSuite">
       <jvmarg value="-Xss8m" />
       <classpath>
-        <fileset dir="${gwt.tools.lib}" includes="tomcat/servlet-api-2.5.jar" />
+        <fileset dir="${gwt.tools.lib}" includes="jetty/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar" />
         <fileset dir="${gwt.tools.lib}" includes="apache/log4j/log4j-1.2.16.jar" />
         <fileset dir="${gwt.tools.lib}" includes="slf4j/slf4j-api/slf4j-api-1.6.1.jar" />
         <fileset dir="${gwt.tools.lib}" includes="slf4j/slf4j-log4j12/slf4j-log4j12-1.6.1.jar" />
diff --git a/user/build.xml b/user/build.xml
index 42a0758..1a77b29 100755
--- a/user/build.xml
+++ b/user/build.xml
@@ -90,7 +90,7 @@
     <mkdir dir="${javac.out}" />
     <gwt.javac excludes="**/super/**">
       <classpath>
-        <pathelement location="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" />
+        <pathelement location="${gwt.tools.lib}/jetty/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar" />
         <pathelement location="${gwt.tools.lib}/junit/junit-4.8.2.jar" />
         <pathelement location="${gwt.tools.lib}/jfreechart/jfreechart-1.0.3.jar" />
         <pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
@@ -210,7 +210,7 @@
       <fileset dir="src" excludes="**/package.html" />
       <fileset dir="super" excludes="**/package.html" />
       <fileset dir="${javac.out}" />
-      <zipfileset src="${gwt.tools.lib}/tomcat/servlet-api-2.5.jar" excludes="**/*.java"/>
+      <zipfileset src="${gwt.tools.lib}/jetty/jetty-8.1.12.v20130726/servlet-api-3.0-NoMetaInf.jar" excludes="**/*.java"/>
       <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
       <zipfileset src="${gwt.tools.lib}/w3c/flute/flute-1.3-gg2.jar" />
       <zipfileset src="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar" />
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 5c12917..ffcfe98 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -73,8 +73,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestResult;
 
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.webapp.WebAppContext;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.webapp.WebAppContext;
 
 import java.io.File;
 import java.lang.reflect.Constructor;
@@ -606,7 +606,7 @@
         {
           // Prevent file locking on Windows; pick up file changes.
           getInitParams().put(
-              "org.mortbay.jetty.servlet.Default.useFileMappedBuffer", "false");
+              "org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
 
           // Prefer the parent class loader so that JUnit works.
           setParentLoaderPriority(true);
@@ -1144,10 +1144,9 @@
       path = '/' + module.getName() + path;
       if (!servletClass.equals(loadedServletsByPath.get(path))) {
         try {
-          Class<?> clazz = wac.loadClass(servletClass);
-          wac.addServlet(clazz, path);
+          wac.addServlet(servletClass, path);
           loadedServletsByPath.put(path, servletClass);
-        } catch (ClassNotFoundException e) {
+        } catch (Exception e) {
           getTopLogger().log(
               TreeLogger.WARN,
               "Failed to load servlet class '" + servletClass
diff --git a/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java b/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java
index 93d2dbb..e81f885 100644
--- a/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java
+++ b/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java
@@ -35,9 +35,6 @@
 
 import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject;
 
-import org.w3c.css.sac.CSSParseException;
-import org.w3c.css.sac.ErrorHandler;
-
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -99,28 +96,9 @@
     public void run() {
       WebClient webClient = new WebClient(browser);
       webClient.setAlertHandler(this);
-      // Adding a handler that ignores errors to work-around
-      // https://sourceforge.net/tracker/?func=detail&aid=3090806&group_id=47038&atid=448266
-      webClient.setCssErrorHandler(new ErrorHandler() {
-
-        public void error(CSSParseException exception) {
-          // ignore
-        }
-
-        public void fatalError(CSSParseException exception) {
-          treeLogger.log(TreeLogger.WARN,
-              "CSS fatal error: " + exception.getURI() + " ["
-                  + exception.getLineNumber() + ":"
-                  + exception.getColumnNumber() + "] " + exception.getMessage());
-        }
-
-        public void warning(CSSParseException exception) {
-          // ignore
-        }
-      });
       webClient.setIncorrectnessListener(this);
-      webClient.setThrowExceptionOnFailingStatusCode(false);
-      webClient.setThrowExceptionOnScriptError(true);
+      webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
+      webClient.getOptions().setThrowExceptionOnScriptError(true);
       webClient.setOnbeforeunloadHandler(this);
       webClient.setJavaScriptErrorListener(new JavaScriptErrorListener() {
 
@@ -237,8 +215,8 @@
   private static Map<String, BrowserVersion> createBrowserMap() {
     Map<String, BrowserVersion> browserMap = new HashMap<String, BrowserVersion>();
     for (BrowserVersion browser : new BrowserVersion[] {
-        BrowserVersion.FIREFOX_3, BrowserVersion.FIREFOX_3_6, BrowserVersion.INTERNET_EXPLORER_6,
-        BrowserVersion.INTERNET_EXPLORER_7}) {
+        BrowserVersion.FIREFOX_17, BrowserVersion.INTERNET_EXPLORER_8,
+        BrowserVersion.INTERNET_EXPLORER_9, BrowserVersion.CHROME}) {
       browserMap.put(browser.getNickname(), browser);
     }
     return Collections.unmodifiableMap(browserMap);
@@ -263,8 +241,8 @@
   @Override
   public int initialize(String args) {
     if (args == null || args.length() == 0) {
-      // If no browsers specified, default to Firefox 3.
-      args = "FF3";
+      // If no browsers specified, default to Firefox 17.
+      args = "FF17";
     }
     Set<BrowserVersion> browserSet = new HashSet<BrowserVersion>();
     for (String browserName : args.split(",")) {
diff --git a/user/test/com/google/gwt/user/server/rpc/LogFilterServletContext.java b/user/test/com/google/gwt/user/server/rpc/LogFilterServletContext.java
index 6ebaa39..6caa54b 100644
--- a/user/test/com/google/gwt/user/server/rpc/LogFilterServletContext.java
+++ b/user/test/com/google/gwt/user/server/rpc/LogFilterServletContext.java
@@ -19,12 +19,21 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
+import java.util.EventListener;
+import java.util.Map;
 import java.util.Set;
 
+import javax.servlet.Filter;
+import javax.servlet.FilterRegistration;
+import javax.servlet.FilterRegistration.Dynamic;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 @SuppressWarnings(value = {"deprecation", "unchecked"})
 abstract class LogFilterServletContext implements ServletContext {
@@ -140,5 +149,110 @@
     realContext.setAttribute(name, object);
   }
 
+  public Dynamic addFilter(String arg0, Class<? extends Filter> arg1) {
+    return realContext.addFilter(arg0, arg1);
+  }
+
+  public Dynamic addFilter(String arg0, Filter arg1) {
+    return realContext.addFilter(arg0, arg1);
+  }
+
+  public Dynamic addFilter(String arg0, String arg1) {
+    return realContext.addFilter(arg0, arg1);
+  }
+
+  public void addListener(Class<? extends EventListener> arg0) {
+    realContext.addListener(arg0);
+  }
+
+  public void addListener(String arg0) {
+    realContext.addListener(arg0);
+  }
+
+  public <T extends EventListener> void addListener(T arg0) {
+    realContext.addListener(arg0);
+  }
+
+  public javax.servlet.ServletRegistration.Dynamic addServlet(
+      String arg0, Class<? extends Servlet> arg1) {
+    return realContext.addServlet(arg0, arg1);
+  }
+
+  public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0, Servlet arg1) {
+    return realContext.addServlet(arg0, arg1);
+  }
+
+  public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0, String arg1) {
+    return realContext.addServlet(arg0, arg1);
+  }
+
+  public <T extends Filter> T createFilter(Class<T> arg0) throws ServletException {
+    return realContext.createFilter(arg0);
+  }
+
+  public <T extends EventListener> T createListener(Class<T> arg0) throws ServletException {
+    return realContext.createListener(arg0);
+  }
+
+  public <T extends Servlet> T createServlet(Class<T> arg0) throws ServletException {
+    return realContext.createServlet(arg0);
+  }
+
+  public void declareRoles(String... arg0) {
+    realContext.declareRoles(arg0);
+  }
+
+  public ClassLoader getClassLoader() {
+    return realContext.getClassLoader();
+  }
+
+  public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
+    return realContext.getDefaultSessionTrackingModes();
+  }
+
+  public int getEffectiveMajorVersion() {
+    return realContext.getEffectiveMajorVersion();
+  }
+
+  public int getEffectiveMinorVersion() {
+    return realContext.getEffectiveMinorVersion();
+  }
+
+  public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+    return realContext.getEffectiveSessionTrackingModes();
+  }
+
+  public FilterRegistration getFilterRegistration(String arg0) {
+    return realContext.getFilterRegistration(arg0);
+  }
+
+  public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+    return realContext.getFilterRegistrations();
+  }
+
+  public JspConfigDescriptor getJspConfigDescriptor() {
+    return realContext.getJspConfigDescriptor();
+  }
+
+  public ServletRegistration getServletRegistration(String arg0) {
+    return realContext.getServletRegistration(arg0);
+  }
+
+  public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+    return realContext.getServletRegistrations();
+  }
+
+  public SessionCookieConfig getSessionCookieConfig() {
+    return realContext.getSessionCookieConfig();
+  }
+
+  public boolean setInitParameter(String arg0, String arg1) {
+    return realContext.setInitParameter(arg0, arg1);
+  }
+
+  public void setSessionTrackingModes(Set<SessionTrackingMode> arg0) {
+    realContext.setSessionTrackingModes(arg0);
+  }
+
   protected abstract boolean shouldLog(Throwable t, String msg);
 }
\ No newline at end of file
diff --git a/user/test/com/google/gwt/user/server/rpc/MockHttpServletRequest.java b/user/test/com/google/gwt/user/server/rpc/MockHttpServletRequest.java
index 865c48c..1772c68 100644
--- a/user/test/com/google/gwt/user/server/rpc/MockHttpServletRequest.java
+++ b/user/test/com/google/gwt/user/server/rpc/MockHttpServletRequest.java
@@ -18,21 +18,38 @@
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import javax.servlet.http.Part;
 
 /**
  * A dummy class for testing methods that require an HttpServletRequest.
  */
 public class MockHttpServletRequest implements HttpServletRequest {
 
+  public boolean authenticate(HttpServletResponse arg0) throws IOException, ServletException {
+    throw new UnsupportedOperationException();
+  }
+
+  public AsyncContext getAsyncContext() {
+    throw new UnsupportedOperationException();
+  }
+
   public Object getAttribute(String arg0) {
     throw new UnsupportedOperationException();
   }
@@ -69,6 +86,10 @@
     throw new UnsupportedOperationException();
   }
 
+  public DispatcherType getDispatcherType() {
+    throw new UnsupportedOperationException();
+  }
+
   public String getHeader(String arg0) {
     throw new UnsupportedOperationException();
   }
@@ -129,6 +150,14 @@
     throw new UnsupportedOperationException();
   }
 
+  public Part getPart(String arg0) throws IOException, ServletException {
+    throw new UnsupportedOperationException();
+  }
+
+  public Collection<Part> getParts() throws IOException, ServletException {
+    throw new UnsupportedOperationException();
+  }
+
   public String getPathInfo() {
     throw new UnsupportedOperationException();
   }
@@ -197,6 +226,10 @@
     throw new UnsupportedOperationException();
   }
 
+  public ServletContext getServletContext() {
+    throw new UnsupportedOperationException();
+  }
+
   public String getServletPath() {
     throw new UnsupportedOperationException();
   }
@@ -213,6 +246,14 @@
     throw new UnsupportedOperationException();
   }
 
+  public boolean isAsyncStarted() {
+    throw new UnsupportedOperationException();
+  }
+
+  public boolean isAsyncSupported() {
+    throw new UnsupportedOperationException();
+  }
+
   public boolean isRequestedSessionIdFromCookie() {
     throw new UnsupportedOperationException();
   }
@@ -237,6 +278,14 @@
     throw new UnsupportedOperationException();
   }
 
+  public void login(String arg0, String arg1) throws ServletException {
+    throw new UnsupportedOperationException();
+  }
+
+  public void logout() throws ServletException {
+    throw new UnsupportedOperationException();
+  }
+
   public void removeAttribute(String arg0) {
     throw new UnsupportedOperationException();
   }
@@ -248,4 +297,13 @@
   public void setCharacterEncoding(String arg0) {
     throw new UnsupportedOperationException();
   }
+
+  public AsyncContext startAsync() throws IllegalStateException {
+    throw new UnsupportedOperationException();
+  }
+
+  public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1)
+      throws IllegalStateException {
+    throw new UnsupportedOperationException();
+  }
 }
diff --git a/user/test/com/google/gwt/user/server/rpc/RemoteServiceServletTest.java b/user/test/com/google/gwt/user/server/rpc/RemoteServiceServletTest.java
index 6ab9605..518cc4a 100644
--- a/user/test/com/google/gwt/user/server/rpc/RemoteServiceServletTest.java
+++ b/user/test/com/google/gwt/user/server/rpc/RemoteServiceServletTest.java
@@ -27,13 +27,22 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
+import java.util.EventListener;
+import java.util.Map;
 import java.util.Set;
 
+import javax.servlet.Filter;
+import javax.servlet.FilterRegistration;
+import javax.servlet.FilterRegistration.Dynamic;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 /**
  * Test some of the failure modes associated with
@@ -168,7 +177,7 @@
       throw new UnsupportedOperationException();
     }
 
-    public Enumeration<String> getServlets() {
+    public Enumeration<Servlet> getServlets() {
       throw new UnsupportedOperationException();
     }
 
@@ -190,6 +199,111 @@
     public void setAttribute(String arg0, Object arg1) {
       throw new UnsupportedOperationException();
     }
+
+    public Dynamic addFilter(String arg0, String arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public Dynamic addFilter(String arg0, Filter arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public Dynamic addFilter(String arg0, Class<? extends Filter> arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public void addListener(String arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public <T extends EventListener> void addListener(T arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public void addListener(Class<? extends EventListener> arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0, String arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public javax.servlet.ServletRegistration.Dynamic addServlet(String arg0, Servlet arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public javax.servlet.ServletRegistration.Dynamic addServlet(
+        String arg0, Class<? extends Servlet> arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public <T extends Filter> T createFilter(Class<T> arg0) throws ServletException {
+      throw new UnsupportedOperationException();
+    }
+
+    public <T extends EventListener> T createListener(Class<T> arg0) throws ServletException {
+      throw new UnsupportedOperationException();
+    }
+
+    public <T extends Servlet> T createServlet(Class<T> arg0) throws ServletException {
+      throw new UnsupportedOperationException();
+    }
+
+    public void declareRoles(String... arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public ClassLoader getClassLoader() {
+      throw new UnsupportedOperationException();
+    }
+
+    public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
+      throw new UnsupportedOperationException();
+    }
+
+    public int getEffectiveMajorVersion() {
+      throw new UnsupportedOperationException();
+    }
+
+    public int getEffectiveMinorVersion() {
+      throw new UnsupportedOperationException();
+    }
+
+    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+      throw new UnsupportedOperationException();
+    }
+
+    public FilterRegistration getFilterRegistration(String arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+      throw new UnsupportedOperationException();
+    }
+
+    public JspConfigDescriptor getJspConfigDescriptor() {
+      throw new UnsupportedOperationException();
+    }
+
+    public ServletRegistration getServletRegistration(String arg0) {
+      throw new UnsupportedOperationException();
+    }
+
+    public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+      throw new UnsupportedOperationException();
+    }
+
+    public SessionCookieConfig getSessionCookieConfig() {
+      throw new UnsupportedOperationException();
+    }
+
+    public boolean setInitParameter(String arg0, String arg1) {
+      throw new UnsupportedOperationException();
+    }
+
+    public void setSessionTrackingModes(Set<SessionTrackingMode> arg0) {
+      throw new UnsupportedOperationException();
+    }
   }
 
   public void testDoGetSerializationPolicy_FailToOpenMD5Resource()
diff --git a/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryTestServer.java b/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryTestServer.java
index 3f51bd5..cf6d44b 100644
--- a/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryTestServer.java
+++ b/user/test/com/google/web/bindery/requestfactory/server/RequestFactoryTestServer.java
@@ -15,12 +15,15 @@
  */
 package com.google.web.bindery.requestfactory.server;
 
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.bio.SocketConnector;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.SessionHandler;
-import org.mortbay.servlet.GzipFilter;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.bio.SocketConnector;
+import org.eclipse.jetty.server.session.SessionHandler;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlets.GzipFilter;
+
+import java.util.EnumSet;
+
+import javax.servlet.DispatcherType;
 
 /**
  * A utility class for hosting an instance of {@link RequestFactoryServlet}.
@@ -33,13 +36,15 @@
     connector.setPort(9999);
     server.addConnector(connector);
 
-    Context ctx = new Context();
-    ctx.addServlet(RequestFactoryServlet.class, "/gwtRequest");
-    ctx.addFilter(GzipFilter.class, "*", Handler.DEFAULT);
+    ServletContextHandler handler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+    handler.setContextPath("/");
+    handler.addServlet(RequestFactoryServlet.class, "/gwtRequest");
+    handler.addFilter(GzipFilter.class, "/*", EnumSet.allOf(DispatcherType.class));
+
     SessionHandler sessionHandler = new SessionHandler();
     sessionHandler.getSessionManager().setMaxInactiveInterval(5);
-    ctx.setSessionHandler(sessionHandler);
-    server.addHandler(ctx);
+    handler.setSessionHandler(sessionHandler);
+    server.setHandler(handler);
 
     try {
       server.start();