Changes in / [4f14677:f57f49c3]


Ignore:
Files:
4 added
9 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • LICENSE.txt

    r4f14677 rf57f49c3  
    178178   See licenses/LICENSE-GPLv2.txt
    179179
    180    Jetty 6.1.26:
    181    Copyright 1995-2009 Mort Bay Consulting Pty Ltd
    182    See licenses/LICENSE-Jetty.txt
    183    See licenses/LICENSE-Apache2.0.txt
     180   Jetty 7.6.8.v20121106:
     181   See licenses/ABOUT-Jetty.html
     182   See licenses/NOTICE-Jetty.html
     183   See licenses/LICENSE-Apache2.0.txt
     184   See licenses/LICENSE-ECLIPSE-1.0.html
    184185   See licenses/NOTICE-Commons-Logging.txt
    185186
  • apps/i2psnark/java/build.xml

    r4f14677 rf57f49c3  
    2020                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
    2121                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
     22                <pathelement location="../../jetty/jettylib/jetty-servlet.jar" />
    2223                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
    2324            </classpath>
     
    3940            destdir="./build/obj"
    4041            includeAntRuntime="false"
    41             classpath="../../../core/java/build/i2p.jar:../../jetty/jettylib/org.mortbay.jetty.jar:../../jetty/jettylib/javax.servlet.jar:../../jetty/jettylib/jetty-util.jar:../../ministreaming/java/build/mstreaming.jar" >
     42            classpath="../../../core/java/build/i2p.jar:../../jetty/jettylib/org.mortbay.jetty.jar:../../jetty/jettylib/javax.servlet.jar:../../jetty/jettylib/jetty-servlet.jar:../../jetty/jettylib/jetty-util.jar:../../ministreaming/java/build/mstreaming.jar" >
    4243            <compilerarg line="${javac.compilerargs}" />
    4344        </javac>
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r4f14677 rf57f49c3  
    4545import org.klomp.snark.dht.DHT;
    4646
    47 import org.mortbay.jetty.servlet.DefaultServlet;
    48 import org.mortbay.resource.Resource;
    49 import org.mortbay.util.URIUtil;
     47import org.eclipse.jetty.servlet.DefaultServlet;
     48import org.eclipse.jetty.util.URIUtil;
     49import org.eclipse.jetty.util.resource.Resource;
    5050
    5151/**
  • apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java

    r4f14677 rf57f49c3  
    66import net.i2p.util.FileUtil;
    77
    8 import org.mortbay.jetty.Server;
     8import org.eclipse.jetty.server.Server;
    99
    1010public class RunStandalone {
  • apps/jetty/build.xml

    r4f14677 rf57f49c3  
    22<project basedir="." default="all" name="jetty">
    33
    4     <property name="jetty.ver" value="6.1.26" />
    5     <property name="jetty.base" value="jetty-${jetty.ver}" />
    6     <property name="jetty.sha1" value="9485913f1a1945a849a90f1a34853d22350bc524" />
     4    <property name="jetty.ver" value="7.6.8.v20121106" />
     5    <property name="jetty.base" value="jetty-distribution-${jetty.ver}" />
     6    <property name="jetty.sha1" value="6fcdc3f532c5ab72843e12cbac3d7cb797cdb5b9" />
    77    <property name="jetty.filename" value="${jetty.base}.zip" />
    8     <property name="jetty.url" value="http://dist.codehaus.org/jetty/${jetty.base}/${jetty.filename}" />
     8    <property name="jetty.url" value="http://download.eclipse.org/jetty/${jetty.ver}/dist/${jetty.filename}" />
    99    <property name="verified.filename" value="verified.txt" />
    1010    <property name="javac.compilerargs" value="" />
     
    9090              start.jar: Needed for clients.config startup of eepsites
    9191              jetty-util-xxx.jar: LifeCycle (base class for stuff), URIUtil (used in i2psnark)
    92               jetty-sslengine-xxx.jar: SSL NIO Connector for console
    93               jetty-java5-threadpool-xxx.jar: Concurrent thread pool for eepsite
     92              jetty-deploy, -http, -io, -security, -servlet, -webapp: All split out from main server jar in Jetty 7
     93              jetty-continuation-xxx.jar: Needed? Useful?
     94              jetty-servlets-xxx.jar: Needed for CGI for eepsite
     95              jetty-sslengine-xxx.jar: Old Jetty 6, now a dummy
     96              jetty-java5-threadpool-xxx.jar: Old Jetty 6, now a dummy
    9497              glassfish 2.1: Not used, too old, see Tomcat below.
    9598              jetty-rewrite-handler: Not used by I2P, but only 20KB and could be useful for eepsites
     
    98101        -->
    99102        <copy preservelastmodified="true" file="${jetty.base}/start.jar" tofile="jettylib/jetty-start.jar" />
    100         <copy file="${jetty.base}/lib/${jetty.base}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
     103        <copy file="${jetty.base}/lib/jetty-server-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jetty.jar" />
     104        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-continuation-${jetty.ver}.jar" tofile="jettylib/jetty-continuation.jar" />
     105        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-deploy-${jetty.ver}.jar" tofile="jettylib/jetty-deploy.jar" />
     106        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-http-${jetty.ver}.jar" tofile="jettylib/jetty-http.jar" />
     107        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-io-${jetty.ver}.jar" tofile="jettylib/jetty-io.jar" />
     108        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-jmx-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
     109        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-rewrite-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
     110        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-security-${jetty.ver}.jar" tofile="jettylib/jetty-security.jar" />
     111        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlet-${jetty.ver}.jar" tofile="jettylib/jetty-servlet.jar" />
     112        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-servlets-${jetty.ver}.jar" tofile="jettylib/jetty-servlets.jar" />
    101113        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-util-${jetty.ver}.jar" tofile="jettylib/jetty-util.jar" />
    102         <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-java5-threadpool-${jetty.ver}.jar" tofile="jettylib/jetty-java5-threadpool.jar" />
    103         <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-rewrite-handler-${jetty.ver}.jar" tofile="jettylib/jetty-rewrite-handler.jar" />
    104         <copy preservelastmodified="true" file="${jetty.base}/lib/ext/jetty-sslengine-${jetty.ver}.jar" tofile="jettylib/jetty-sslengine.jar" />
    105         <copy preservelastmodified="true" file="${jetty.base}/lib/management/jetty-management-${jetty.ver}.jar" tofile="jettylib/org.mortbay.jmx.jar" />
     114        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-webapp-${jetty.ver}.jar" tofile="jettylib/jetty-webapp.jar" />
     115        <copy preservelastmodified="true" file="${jetty.base}/lib/jetty-xml-${jetty.ver}.jar" tofile="jettylib/jetty-xml.jar" />
     116        <jar destfile="jettylib/jetty-java5-threadpool.jar" >
     117            <manifest>
     118                <attribute name="Note" value="Intentionally empty" />
     119            </manifest>
     120        </jar>
     121        <jar destfile="jettylib/jetty-sslengine.jar" >
     122            <manifest>
     123                <attribute name="Note" value="Intentionally empty" />
     124            </manifest>
     125        </jar>
    106126        <delete file="jetty.tar" />
    107127      <!--
     
    156176
    157177    <target name="builddep" />
     178
    158179    <target name="compile" depends="builddep, ensureJettylib" >
    159180        <mkdir dir="./build" />
     
    161182        <javac
    162183            srcdir="./java/src"
    163             debug="true" source="1.5" target="1.5"
     184            debug="true" deprecation="on" source="1.5" target="1.5"
    164185            destdir="./build/obj"
    165186            includeAntRuntime="false"
    166             classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-util.jar" >
     187            classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
    167188            <compilerarg line="${javac.compilerargs}" />
    168189        </javac>
  • apps/jetty/java/src/net/i2p/jetty/I2PLogger.java

    r4f14677 rf57f49c3  
    1818import net.i2p.util.Log;
    1919
    20 import org.mortbay.jetty.Server;
    21 import org.mortbay.log.Logger;
     20import org.eclipse.jetty.server.Server;
     21import org.eclipse.jetty.util.log.Logger;
    2222
    2323/**
    2424 * Modified from Jetty 6.1.26 StdErrLog.java and Slf4jLog.java
    2525 *
    26  * Usage: org.mortbay.log.Log.setLog(new I2PLogger(ctx));
     26 * Usage: org.eclipse.log.Log.setLog(new I2PLogger(ctx));
    2727 *
    2828 * @since Jetty 6
     
    183183    }
    184184   
    185 
     185    /**
     186     *  @since Jetty 7
     187     */
     188    public void ignore(Throwable ignored)
     189    {
     190            warn("IGNORED", ignored);
     191    }
     192   
     193    /**
     194     *  @since Jetty 7
     195     */
     196    public void debug(Throwable thrown)
     197    {
     198            debug("", thrown);
     199    }
     200   
     201    /**
     202     *  @since Jetty 7
     203     */
     204    public void debug(String msg, Object... args)
     205    {
     206            Object a1 = args.length > 0 ? args[0] : null;
     207            Object a2 = args.length > 1 ? args[1] : null;
     208            debug(msg, a1, a2);
     209    }
     210   
     211    /**
     212     *  @since Jetty 7
     213     */
     214    public void info(Throwable thrown)
     215    {
     216            info("", thrown);
     217    }
     218   
     219    /**
     220     *  @since Jetty 7
     221     */
     222    public void info(String msg, Object... args)
     223    {
     224            Object a1 = args.length > 0 ? args[0] : null;
     225            Object a2 = args.length > 1 ? args[1] : null;
     226            info(msg, a1, a2);
     227    }
     228   
     229    /**
     230     *  @since Jetty 7
     231     */
     232    public void info(String msg, Throwable th)
     233    {
     234        _log.info(msg,th);
     235    }
     236
     237    /**
     238     *  @since Jetty 7
     239     */
     240    public void warn(Throwable thrown)
     241    {
     242            warn("", thrown);
     243    }
     244   
     245    /**
     246     *  @since Jetty 7
     247     */
     248    public void warn(String msg, Object... args)
     249    {
     250            Object a1 = args.length > 0 ? args[0] : null;
     251            Object a2 = args.length > 1 ? args[1] : null;
     252            warn(msg, a1, a2);
     253    }
     254
     255    /**
     256     *  @since Jetty 7
     257     */
     258    public String getName() {
     259        return "net.i2p.jetty.I2PLogger";
     260    }
    186261}
  • apps/jetty/java/src/net/i2p/jetty/I2PRequestLog.java

    r4f14677 rf57f49c3  
    2525import javax.servlet.http.Cookie;
    2626
    27 import org.mortbay.component.AbstractLifeCycle;
    28 import org.mortbay.jetty.HttpHeaders;
    29 import org.mortbay.jetty.Request;
    30 import org.mortbay.jetty.RequestLog;
    31 import org.mortbay.jetty.Response;
    32 import org.mortbay.jetty.servlet.PathMap;
    33 import org.mortbay.log.Log;
    34 import org.mortbay.util.DateCache;
    35 import org.mortbay.util.RolloverFileOutputStream;
    36 import org.mortbay.util.StringUtil;
    37 import org.mortbay.util.TypeUtil;
    38 import org.mortbay.util.Utf8StringBuffer;
     27import org.eclipse.jetty.http.HttpHeaders;
     28import org.eclipse.jetty.http.PathMap;
     29import org.eclipse.jetty.server.Request;
     30import org.eclipse.jetty.server.RequestLog;
     31import org.eclipse.jetty.server.Response;
     32import org.eclipse.jetty.util.DateCache;
     33import org.eclipse.jetty.util.RolloverFileOutputStream;
     34import org.eclipse.jetty.util.StringUtil;
     35import org.eclipse.jetty.util.TypeUtil;
     36import org.eclipse.jetty.util.Utf8StringBuilder;
     37import org.eclipse.jetty.util.component.AbstractLifeCycle;
     38import org.eclipse.jetty.util.log.Log;
    3939
    4040/**
     
    5757 * So that we will work with system Jetty 6 packages, we just copy the whole thing
    5858 * and modify log() as required.
    59  * We leave the package as org.mortbay.http for compatibility with old
    60  * jetty.xml files.
    6159 *
    6260 * @author Greg Wilkins
     
    260258                return;
    261259
    262             Utf8StringBuffer u8buf;
    263             StringBuffer buf;
     260            Utf8StringBuilder u8buf;
     261            StringBuilder buf;
    264262            synchronized(_writer)
    265263            {
    266264                int size=_buffers.size();
    267                 u8buf = size==0?new Utf8StringBuffer(160):(Utf8StringBuffer)_buffers.remove(size-1);
    268                 buf = u8buf.getStringBuffer();
     265                u8buf = size==0?new Utf8StringBuilder(160):(Utf8StringBuilder)_buffers.remove(size-1);
     266                buf = u8buf.getStringBuilder();
    269267            }
    270268           
     
    399397                    {
    400398                        _writer.write(' ');
    401                         _writer.write(TypeUtil.toString(System.currentTimeMillis() - request.getTimeStamp()));
     399                        _writer.write(Long.toString(System.currentTimeMillis() - request.getTimeStamp()));
    402400                    }
    403401
  • apps/jetty/java/src/net/i2p/jetty/JettyStart.java

    r4f14677 rf57f49c3  
    2020import java.util.Arrays;
    2121import java.util.List;
     22import java.util.Map;
    2223import java.util.Properties;
    2324
     
    2627import static net.i2p.app.ClientAppState.*;
    2728
    28 import org.mortbay.component.LifeCycle;
    29 import org.mortbay.resource.Resource;
    30 import org.mortbay.xml.XmlConfiguration;
     29import org.eclipse.jetty.util.component.LifeCycle;
     30import org.eclipse.jetty.util.resource.Resource;
     31import org.eclipse.jetty.xml.XmlConfiguration;
    3132
    3233/**
     
    7475                if (last!=null)
    7576                    configuration.getIdMap().putAll(last.getIdMap());
    76                 if (properties.size()>0)
    77                     configuration.setProperties(properties);
     77                if (properties.size()>0) {
     78                    // to avoid compiler errror
     79                    Map foo = configuration.getProperties();
     80                    foo.putAll(properties);
     81                }
    7882                Object o = configuration.configure();
    7983                if (o instanceof LifeCycle)
  • apps/routerconsole/java/build.xml

    r4f14677 rf57f49c3  
    6464                <pathelement location="../../../router/java/build/router.jar" />
    6565                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
     66                <pathelement location="../../jetty/jettylib/jetty-http.jar" />
     67                <pathelement location="../../jetty/jettylib/jetty-io.jar" />
     68                <pathelement location="../../jetty/jettylib/jetty-security.jar" />
     69                <pathelement location="../../jetty/jettylib/jetty-servlet.jar" />
     70                <pathelement location="../../jetty/jettylib/jetty-servlets.jar" />
    6671                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
    67                 <pathelement location="../../jetty/jettylib/jetty-sslengine.jar" />
    68                 <pathelement location="../../jetty/jettylib/jetty-java5-threadpool.jar" />
     72                <pathelement location="../../jetty/jettylib/jetty-webapp.jar" />
    6973                <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
    7074                <pathelement location="../../jetty/jettylib/jsp-api.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java

    r4f14677 rf57f49c3  
    1818import static net.i2p.update.UpdateType.*;
    1919
    20 import org.mortbay.jetty.handler.ContextHandlerCollection;
     20import org.eclipse.jetty.server.handler.ContextHandlerCollection;
    2121
    2222/**
  • apps/routerconsole/java/src/net/i2p/router/web/ConsolePasswordManager.java

    r4f14677 rf57f49c3  
    1313import net.i2p.router.util.RouterPasswordManager;
    1414
    15 //import org.mortbay.jetty.security.UnixCrypt;
     15//import org.eclipse.jetty.util.security.UnixCrypt;
    1616
    1717/**
  • apps/routerconsole/java/src/net/i2p/router/web/LocaleWebAppHandler.java

    r4f14677 rf57f49c3  
    11package net.i2p.router.web;
    22
     3import java.io.File;
    34import java.io.IOException;
    45import java.util.Locale;
     
    1112import net.i2p.I2PAppContext;
    1213
    13 import org.mortbay.jetty.webapp.WebAppContext;
     14import org.eclipse.jetty.server.Request;
     15import org.eclipse.jetty.server.handler.HandlerWrapper;
     16import org.eclipse.jetty.server.session.SessionHandler;
     17import org.eclipse.jetty.servlet.ServletHandler;
     18import org.eclipse.jetty.webapp.WebAppContext;
    1419
    1520/**
     
    2227 * @author zzz
    2328 */
    24 public class LocaleWebAppHandler extends WebAppContext
     29public class LocaleWebAppHandler extends HandlerWrapper
    2530{
    2631    private final I2PAppContext _context;
     32    private final WebAppContext _wac;
    2733
    28     public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath) {
    29         super(warPath, path);
     34    public LocaleWebAppHandler(I2PAppContext ctx, String path, String warPath,
     35                               File tmpdir, ServletHandler servletHandler) {
     36        super();
    3037        _context = ctx;
     38        _wac = new WebAppContext(warPath, path);
    3139        setInitParams(WebAppStarter.INIT_PARAMS);
     40        _wac.setTempDirectory(tmpdir);
     41        _wac.setExtractWAR(false);
     42        _wac.setSessionHandler(new SessionHandler());
     43        _wac.setServletHandler(servletHandler);
     44        setHandler(_wac);
    3245    }
    3346   
     
    3851     *  Unless language == "en".
    3952     */
    40     @Override
    4153    public void handle(String pathInContext,
     54                       Request baseRequest,
    4255                       HttpServletRequest httpRequest,
    43                        HttpServletResponse httpResponse,
    44                        int dispatch)
     56                       HttpServletResponse httpResponse)
    4557         throws IOException, ServletException
    4658    {
    47         // Handle OPTIONS (nothing to override)
    48         if ("OPTIONS".equals(httpRequest.getMethod()))
    49         {
    50             handleOptions(httpRequest, httpResponse);
    51             return;
    52         }
    5359
    5460        // transparent rewriting
     
    7884                    String testPath = pathInContext.substring(0, len - 4) + '_' + lang + ".jsp";
    7985                    // Do we have a servlet for the new path that isn't the catchall *.jsp?
    80                     Map.Entry servlet = getServletHandler().getHolderEntry(testPath);
     86                    Map.Entry servlet = _wac.getServletHandler().getHolderEntry(testPath);
    8187                    if (servlet != null) {
    8288                        String servletPath = (String) servlet.getKey();
     
    9197        }
    9298        //System.err.println("New path: " + newPath);
    93         super.handle(newPath, httpRequest, httpResponse, dispatch);
     99        super.handle(newPath, baseRequest, httpRequest, httpResponse);
    94100        //System.err.println("Was handled? " + httpRequest.isHandled());
    95101    }
     
    113119     *  @since 0.8
    114120     */
     121/****  not in Jetty 7
    115122    public void handleOptions(HttpServletRequest request,
    116123                              HttpServletResponse response)
     
    119126        response.sendError(405);
    120127    }
     128****/
     129
     130    /**
     131     *  Mysteriously removed from Jetty 7
     132     */
     133    private void setInitParams(Map params) {
     134        setInitParams(_wac, params);
     135    }
     136
     137    /**
     138     *  @since Jetty 7
     139     */
     140    public static void setInitParams(WebAppContext context, Map<?,?> params) {
     141        for (Map.Entry e : params.entrySet()) {
     142            context.setInitParameter((String)e.getKey(), (String)e.getValue());
     143        }
     144    }
    121145}
  • apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java

    r4f14677 rf57f49c3  
    88import net.i2p.util.VersionComparator;
    99
    10 import org.mortbay.jetty.Server;
     10import org.eclipse.jetty.server.Server;
    1111import org.tanukisoftware.wrapper.WrapperManager;
    1212
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java

    r4f14677 rf57f49c3  
    3535import net.i2p.util.VersionComparator;
    3636
    37 import org.mortbay.jetty.handler.ContextHandlerCollection;
     37import org.eclipse.jetty.server.handler.ContextHandlerCollection;
    3838
    3939
  • apps/routerconsole/java/src/net/i2p/router/web/RouterConsoleRunner.java

    r4f14677 rf57f49c3  
    4343import net.i2p.util.VersionComparator;
    4444
    45 import org.mortbay.jetty.AbstractConnector;
    46 import org.mortbay.jetty.Connector;
    47 import org.mortbay.jetty.NCSARequestLog;
    48 import org.mortbay.jetty.Server;
    49 import org.mortbay.jetty.bio.SocketConnector;
    50 import org.mortbay.jetty.handler.ContextHandlerCollection;
    51 import org.mortbay.jetty.handler.DefaultHandler;
    52 import org.mortbay.jetty.handler.HandlerCollection;
    53 import org.mortbay.jetty.handler.RequestLogHandler;
    54 import org.mortbay.jetty.nio.SelectChannelConnector;
    55 import org.mortbay.jetty.security.Credential.MD5;
    56 import org.mortbay.jetty.security.DigestAuthenticator;
    57 import org.mortbay.jetty.security.HashUserRealm;
    58 import org.mortbay.jetty.security.Constraint;
    59 import org.mortbay.jetty.security.ConstraintMapping;
    60 import org.mortbay.jetty.security.SecurityHandler;
    61 import org.mortbay.jetty.security.SslSocketConnector;
    62 import org.mortbay.jetty.security.SslSelectChannelConnector;
    63 import org.mortbay.jetty.servlet.ServletHandler;
    64 import org.mortbay.jetty.servlet.ServletHolder;
    65 import org.mortbay.jetty.servlet.SessionHandler;
    66 import org.mortbay.jetty.webapp.WebAppContext;
    67 import org.mortbay.thread.QueuedThreadPool;
    68 import org.mortbay.thread.concurrent.ThreadPool;
     45import org.eclipse.jetty.security.HashLoginService;
     46import org.eclipse.jetty.security.ConstraintMapping;
     47import org.eclipse.jetty.security.ConstraintSecurityHandler;
     48import org.eclipse.jetty.security.SecurityHandler;
     49import org.eclipse.jetty.security.authentication.DigestAuthenticator;
     50import org.eclipse.jetty.server.AbstractConnector;
     51import org.eclipse.jetty.server.Connector;
     52import org.eclipse.jetty.server.NCSARequestLog;
     53import org.eclipse.jetty.server.Server;
     54import org.eclipse.jetty.server.bio.SocketConnector;
     55import org.eclipse.jetty.server.handler.ContextHandlerCollection;
     56import org.eclipse.jetty.server.handler.DefaultHandler;
     57import org.eclipse.jetty.server.handler.HandlerCollection;
     58import org.eclipse.jetty.server.handler.HandlerWrapper;
     59import org.eclipse.jetty.server.handler.RequestLogHandler;
     60import org.eclipse.jetty.server.nio.SelectChannelConnector;
     61import org.eclipse.jetty.server.ssl.SslSocketConnector;
     62import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
     63import org.eclipse.jetty.servlet.ServletHandler;
     64import org.eclipse.jetty.servlet.ServletHolder;
     65import org.eclipse.jetty.webapp.WebAppContext;
     66import org.eclipse.jetty.util.security.Constraint;
     67import org.eclipse.jetty.util.security.Credential;
     68import org.eclipse.jetty.util.security.Credential.MD5;
     69import org.eclipse.jetty.util.thread.ExecutorThreadPool;
     70import org.eclipse.jetty.util.thread.QueuedThreadPool;
     71import org.eclipse.jetty.util.thread.ThreadPool;
    6972
    7073/**
     
    294297        //}
    295298        // This way it doesn't try to load Slf4jLog first
    296         System.setProperty("org.mortbay.log.class", "net.i2p.jetty.I2PLogger");
     299        System.setProperty("org.eclipse.jetty.util.log.class", "net.i2p.jetty.I2PLogger");
    297300
    298301        // so Jetty can find WebAppConfiguration
     
    303306        try {
    304307            ThreadPool ctp = new CustomThreadPoolExecutor();
    305             ctp.prestartAllCoreThreads();
     308            // Gone in Jetty 7
     309            //ctp.prestartAllCoreThreads();
    306310            _server.setThreadPool(ctp);
    307311        } catch (Throwable t) {
     
    316320        HandlerCollection hColl = new HandlerCollection();
    317321        ContextHandlerCollection chColl = new ContextHandlerCollection();
    318         _server.addHandler(hColl);
     322        // gone in Jetty 7
     323        //_server.addHandler(hColl);
     324        _server.setHandler(hColl);
    319325        hColl.addHandler(chColl);
    320326        hColl.addHandler(new DefaultHandler());
     
    352358            _webAppsDir += '/';
    353359
    354         WebAppContext rootWebApp = null;
     360        HandlerWrapper rootWebApp = null;
    355361        ServletHandler rootServletHandler = null;
    356362        List<Connector> connectors = new ArrayList(4);
     
    508514            }
    509515
    510             rootWebApp = new LocaleWebAppHandler(_context,
    511                                                   "/", _webAppsDir + ROUTERCONSOLE + ".war");
    512516            File tmpdir = new SecureDirectory(workDir, ROUTERCONSOLE + "-" +
    513517                                                       (_listenPort != null ? _listenPort : _sslListenPort));
    514518            tmpdir.mkdir();
    515             rootWebApp.setTempDirectory(tmpdir);
    516             rootWebApp.setExtractWAR(false);
    517             rootWebApp.setSessionHandler(new SessionHandler());
    518519            rootServletHandler = new ServletHandler();
    519             rootWebApp.setServletHandler(rootServletHandler);
    520             initialize(_context, rootWebApp);
     520            rootWebApp = new LocaleWebAppHandler(_context,
     521                                                  "/", _webAppsDir + ROUTERCONSOLE + ".war",
     522                                                 tmpdir, rootServletHandler);
     523            initialize(_context, (WebAppContext)(rootWebApp.getHandler()));
    521524            chColl.addHandler(rootWebApp);
    522525
     
    728731     */
    729732    static void initialize(RouterContext ctx, WebAppContext context) {
    730         SecurityHandler sec = new SecurityHandler();
     733        ConstraintSecurityHandler sec = new ConstraintSecurityHandler();
    731734        List<ConstraintMapping> constraints = new ArrayList(4);
    732735        ConsolePasswordManager mgr = new ConsolePasswordManager(ctx);
     
    738741                ctx.router().saveConfig(PROP_CONSOLE_PW, "false");
    739742            } else {
    740                 HashUserRealm realm = new HashUserRealm(JETTY_REALM);
    741                 sec.setUserRealm(realm);
     743                HashLoginService realm = new HashLoginService(JETTY_REALM);
     744                sec.setLoginService(realm);
    742745                sec.setAuthenticator(authenticator);
    743746                for (Map.Entry<String, String> e : userpw.entrySet()) {
    744747                    String user = e.getKey();
    745748                    String pw = e.getValue();
    746                     realm.put(user, MD5.__TYPE + pw);
    747                     realm.addUserToRole(user, JETTY_ROLE);
     749                    realm.putUser(user, Credential.getCredential(MD5.__TYPE + pw), new String[] {JETTY_ROLE});
    748750                    Constraint constraint = new Constraint(user, JETTY_ROLE);
    749751                    constraint.setAuthenticate(true);
     
    844846     * @since Jetty 6
    845847     */
    846     private static class CustomThreadPoolExecutor extends ThreadPool {
     848    private static class CustomThreadPoolExecutor extends ExecutorThreadPool {
    847849        public CustomThreadPoolExecutor() {
    848850             super(MIN_THREADS, MAX_THREADS, MAX_IDLE_TIME, TimeUnit.MILLISECONDS,
    849                    new SynchronousQueue(), new CustomThreadFactory(),
    850                    new ThreadPoolExecutor.CallerRunsPolicy());
     851                   new SynchronousQueue()  /** ,  following args not available in Jetty 7
     852                   new CustomThreadFactory(),
     853                   new ThreadPoolExecutor.CallerRunsPolicy() **/
     854                  );
    851855        }
    852856    }
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java

    r4f14677 rf57f49c3  
    1111import net.i2p.I2PAppContext;
    1212
    13 import org.mortbay.jetty.webapp.Configuration;
    14 import org.mortbay.jetty.webapp.WebAppClassLoader;
    15 import org.mortbay.jetty.webapp.WebAppContext;
     13import org.eclipse.jetty.webapp.Configuration;
     14import org.eclipse.jetty.webapp.WebAppClassLoader;
     15import org.eclipse.jetty.webapp.WebAppContext;
    1616
    1717
     
    3939 */
    4040public class WebAppConfiguration implements Configuration {
    41     private WebAppContext _wac;
    4241
    4342    private static final String CLASSPATH = ".classpath";
    4443
    45     public void setWebAppContext(WebAppContext context) {
    46        _wac = context;
    47     }
    48 
    49     public WebAppContext getWebAppContext() {
    50         return _wac;
    51     }
    52 
    5344    /**
    54      *  This was the interface in Jetty 5, now it's configureClassLoader()
     45     *  This was the interface in Jetty 5, in Jetty 6 was configureClassLoader(),
     46     *  now it's configure()
    5547     */
    56     private void configureClassPath() throws Exception {
    57         String ctxPath = _wac.getContextPath();
     48    private void configureClassPath(WebAppContext wac) throws Exception {
     49        String ctxPath = wac.getContextPath();
    5850        //System.err.println("Configure Class Path " + ctxPath);
    5951        if (ctxPath.equals("/"))
     
    111103        if (buf.length() <= 0)
    112104            return;
    113         ClassLoader cl = _wac.getClassLoader();
     105        ClassLoader cl = wac.getClassLoader();
    114106        if (cl != null && cl instanceof WebAppClassLoader) {
    115107            WebAppClassLoader wacl = (WebAppClassLoader) cl;
     
    119111            // and it calls getExtraClasspath in its constructor
    120112            // Not sure why WACL already exists...
    121             _wac.setExtraClasspath(buf.toString());
     113            wac.setExtraClasspath(buf.toString());
    122114        }
    123115    }
     
    134126    }
    135127
    136     public void configureDefaults() {}
    137     public void configureWebApp() {}
     128    /** @since Jetty 7 */
     129    public void deconfigure(WebAppContext context) {}
    138130
    139     /** @since Jetty 6 */
    140     public void deconfigureWebApp() {}
     131    /** @since Jetty 7 */
     132    public void configure(WebAppContext context) throws Exception {
     133        configureClassPath(context);
     134    }
    141135
    142     /** @since Jetty 6 */
    143     public void configureClassLoader() throws Exception {
    144         configureClassPath();
     136    /** @since Jetty 7 */
     137    public void cloneConfigure(WebAppContext template, WebAppContext context) {
     138        // no state, nothing to be done
    145139    }
     140
     141    /** @since Jetty 7 */
     142    public void destroy(WebAppContext context) {}
     143
     144    /** @since Jetty 7 */
     145    public void preConfigure(WebAppContext context) {}
     146
     147    /** @since Jetty 7 */
     148    public void postConfigure(WebAppContext context) {}
    146149}
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java

    r4f14677 rf57f49c3  
    1111import net.i2p.util.SecureDirectory;
    1212
    13 import org.mortbay.jetty.Handler;
    14 import org.mortbay.jetty.Server;
    15 import org.mortbay.jetty.webapp.WebAppContext;
    16 import org.mortbay.jetty.handler.ContextHandler;
    17 import org.mortbay.jetty.handler.ContextHandlerCollection;
     13import org.eclipse.jetty.server.Handler;
     14import org.eclipse.jetty.server.Server;
     15import org.eclipse.jetty.server.handler.ContextHandler;
     16import org.eclipse.jetty.server.handler.ContextHandlerCollection;
     17import org.eclipse.jetty.webapp.WebAppContext;
    1818
    1919
     
    5757         WebAppContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);     
    5858         //_log.debug("Loading war from: " + warPath);
    59          wac.setInitParams(INIT_PARAMS);
     59         LocaleWebAppHandler.setInitParams(wac, INIT_PARAMS);
    6060         wac.start();
    6161    }
     
    156156        String path = '/'+ appName;
    157157        for (int i = 0; i < handlers.length; i++) {
     158            if (!(handlers[i] instanceof ContextHandler))
     159                continue;
    158160            ContextHandler ch = (ContextHandler) handlers[i];
    159161            if (path.equals(ch.getContextPath()))
  • apps/routerconsole/jsp/error.jsp

    r4f14677 rf57f49c3  
    55<%
    66    // Let's make this easy...
    7     final Integer ERROR_CODE = (Integer) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_STATUS_CODE);
    8     final String ERROR_URI = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_REQUEST_URI);
    9     final String ERROR_MESSAGE = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_MESSAGE);
     7    final Integer ERROR_CODE = (Integer) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_STATUS_CODE);
     8    final String ERROR_URI = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_REQUEST_URI);
     9    final String ERROR_MESSAGE = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_MESSAGE);
    1010    if (ERROR_CODE != null && ERROR_MESSAGE != null) {
    1111        // this is deprecated but we don't want sendError()
  • apps/routerconsole/jsp/error500.jsp

    r4f14677 rf57f49c3  
    44<%
    55    // Let's make this easy...
    6     final Integer ERROR_CODE = (Integer) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_STATUS_CODE);
    7     final String ERROR_URI = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_REQUEST_URI);
    8     final String ERROR_MESSAGE = (String) request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_MESSAGE);
    9     final Class ERROR_CLASS = (Class)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION_TYPE);
    10     final Throwable ERROR_THROWABLE = (Throwable)request.getAttribute(org.mortbay.jetty.servlet.ServletHandler.__J_S_ERROR_EXCEPTION);
     6    final Integer ERROR_CODE = (Integer) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_STATUS_CODE);
     7    final String ERROR_URI = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_REQUEST_URI);
     8    final String ERROR_MESSAGE = (String) request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_MESSAGE);
     9    final Class ERROR_CLASS = (Class)request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_EXCEPTION_TYPE);
     10    final Throwable ERROR_THROWABLE = (Throwable)request.getAttribute(org.eclipse.jetty.server.Dispatcher.ERROR_EXCEPTION);
    1111    if (ERROR_CODE != null && ERROR_MESSAGE != null) {
    1212        // this is deprecated but we don't want sendError()
  • apps/susimail/build.xml

    r4f14677 rf57f49c3  
    2626                <pathelement location="../jetty/jettylib/org.mortbay.jetty.jar" />
    2727                <pathelement location="../jetty/jettylib/jetty-util.jar" />
     28                <pathelement location="../jetty/jettylib/jetty-http.jar" />
    2829                <pathelement location="../../core/java/build/i2p.jar" />
    2930            </classpath>
  • apps/susimail/src/src/org/mortbay/servlet/MultiPartRequest.java

    r4f14677 rf57f49c3  
    3030//import org.apache.commons.logging.Log;
    3131//import org.mortbay.log.LogFactory;
    32 import org.mortbay.jetty.HttpHeaders;
     32import org.eclipse.jetty.http.HttpHeaders;
     33import org.eclipse.jetty.util.MultiMap;
     34import org.eclipse.jetty.util.StringUtil;
    3335import org.mortbay.util.LineInput;
    34 import org.mortbay.util.MultiMap;
    35 import org.mortbay.util.StringUtil;
    3636
    3737/* ------------------------------------------------------------ */
  • build.xml

    r4f14677 rf57f49c3  
    10411041        <exec executable="sh" osfamily="unix" failonerror="true">
    10421042            <arg value="-c" />
    1043             <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
     1043            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
    10441044        </exec>
    10451045        <exec executable="sh" osfamily="mac" failonerror="true">
    10461046            <arg value="-c" />
    1047             <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
     1047            <arg value="for i in pkg-temp/lib/*.jar pkg-temp/webapps/*war; do if [ $i = pkg-temp/lib/jasper-compiler.jar -o $i = pkg-temp/lib/jbigi.jar -o $i = pkg-temp/lib/jetty-java5-threadpool.jar -o $i = pkg-temp/lib/jetty-sslengine.jar ]; then continue; fi; echo pack200 $i; mv $i $i.jar; pack200 -g $i.pack $i.jar; rm -f $i.jar; done" />
    10481048        </exec>
    10491049        <!-- windoz here : i admit, i hate escaped symbols in xml, indeed = =! -->
     
    11541154              can't overwrite an existing eepsite dir in a non-split configuration.
    11551155          -->
    1156         <copy todir="pkg-temp/eepsite-jetty6" >
     1156        <copy todir="pkg-temp/eepsite-jetty7" >
    11571157            <fileset dir="installer/resources/eepsite" includes="*.xml contexts/* etc/*" />
    11581158        </copy>
     
    11601160
    11611161    <target name="delete-j6-update">
    1162         <delete dir="pkg-temp/eepsite-jetty6" />
     1162        <delete dir="pkg-temp/eepsite-jetty7" />
    11631163    </target>
    11641164
  • installer/resources/clients.config

    r4f14677 rf57f49c3  
    4141
    4242# run our own eepsite with a seperate jetty instance
    43 clientApp.3.main=org.mortbay.start.Main
     43clientApp.3.main=net.i2p.jetty.JettyStart
    4444clientApp.3.name=I2P webserver (eepsite)
    4545## To use the rewrite handler, edit jetty-rewrite.xml and use:
  • installer/resources/eepsite/contexts/base-context.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0"  encoding="ISO-8859-1"?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
    44<!--
    55Configure a custom context for the eepsite.
    66
    7 This context contains only a Context with a default servlet
     7This context contains only a ServletContextHandler with a default servlet
    88to serve static html files and images.
    99-->
    1010
    11 <Configure class="org.mortbay.jetty.servlet.Context">
     11<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
    1212  <Set name="contextPath">/</Set>
    1313  <Set name="resourceBase">./eepsite/docroot/</Set>
    14   <Call name="setInitParams">
    15     <Arg>
    16       <Map>
    17         <Entry>
    18           <Item>org.mortbay.jetty.servlet.Default.cacheControl</Item>
    19           <Item>max-age=3600,public</Item>
    20         </Entry>
    21       </Map>
    22     </Arg>
     14  <Call name="setInitParameter">
     15    <Arg>cacheControl</Arg>
     16    <Arg>max-age=3600,public</Arg>
    2317  </Call>
    2418  <Call name="setMimeTypes">
    2519    <Arg>
    26       <New class="org.mortbay.jetty.MimeTypes">
     20      <New class="org.eclipse.jetty.http.MimeTypes">
    2721        <Call name="addMimeMapping">
    2822          <Arg>sud</Arg>
     
    4135  </Call>
    4236  <Call name="addServlet">
    43     <Arg>org.mortbay.jetty.servlet.DefaultServlet</Arg>
     37    <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
    4438    <Arg>/</Arg>
    4539  </Call>
  • installer/resources/eepsite/contexts/cgi-context.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0"  encoding="ISO-8859-1"?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
    44<!--
     
    2323-->
    2424
    25 <Configure class="org.mortbay.jetty.servlet.Context">
     25<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
    2626  <Set name="contextPath">/cgi-bin</Set>
    2727  <Set name="resourceBase">./eepsite/cgi-bin/</Set>
    28   <Call name="setInitParams">
    29     <Arg>
    30       <Map>
    31         <Entry>
    32           <Item>Path</Item>
    33           <Item>/usr/local/bin:/bin:/usr/bin</Item>
    34         </Entry>
    35       </Map>
    36     </Arg>
     28  <Call name="setInitParameter">
     29    <Arg>Path</Arg>
     30    <Arg>/usr/local/bin:/bin:/usr/bin</Arg>
    3731  </Call>
    3832  <Call name="addServlet">
    39     <Arg>org.mortbay.servlet.CGI</Arg>
     33    <Arg>org.eclipse.jetty.servlets.CGI</Arg>
    4034    <Arg>/</Arg>
    4135  </Call>
  • installer/resources/eepsite/etc/webdefault.xml

    r4f14677 rf57f49c3  
    3636  <!-- UNCOMMENT TO ACTIVATE
    3737  <context-param>
    38     <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
     38    <param-name>org.eclipse.jetty.servlet.SessionDomain</param-name>
    3939    <param-value>127.0.0.1</param-value>
    4040  </context-param>
    4141
    4242  <context-param>
    43     <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
     43    <param-name>org.eclipse.jetty.servlet.SessionPath</param-name>
    4444    <param-value>/</param-value>
    4545  </context-param>
    4646
    4747  <context-param>
    48     <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
     48    <param-name>org.eclipse.jetty.servlet.MaxAge</param-name>
    4949    <param-value>-1</param-value>
    5050  </context-param>
     
    5252
    5353  <context-param>
    54     <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
     54    <param-name>org.eclipse.jetty.webapp.NoTLDJarPattern</param-name>
    5555    <param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
    5656  </context-param>
     
    113113  <servlet>
    114114    <servlet-name>default</servlet-name>
    115     <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
     115    <servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
    116116    <init-param>
    117117      <param-name>acceptRanges</param-name>
     
    307307  <servlet>
    308308    <servlet-name>invoker</servlet-name>
    309     <servlet-class>org.mortbay.jetty.servlet.Invoker</servlet-class>
     309    <servlet-class>org.eclipse.jetty.servlet.Invoker</servlet-class>
    310310    <init-param>
    311311      <param-name>verbose</param-name>
  • installer/resources/eepsite/jetty-jmx.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0"?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
     4<!-- ============================================================================ -->
     5<!-- To correctly start Jetty with JMX module enabled, this configuration         -->
     6<!-- file must appear first in the list of the configuration files.               -->
     7<!-- The simplest way to achieve this is to add etc/jetty-jmx.xml as the          -->
     8<!-- first file in configuration file list at the end of start.ini file.          -->
     9<!-- ============================================================================ -->
     10<Configure id="Server" class="org.eclipse.jetty.server.Server">
    411
    5 <!-- =============================================================== -->
    6 <!-- Configure the JVM JMX Server                                    -->
    7 <!-- this configuration file should be used in combination with      -->
    8 <!-- other configuration files.  e.g.                                -->
    9 <!--    java -jar start.jar etc/jetty-jmx.xml etc/jetty.xml          -->
    10 <!-- See jetty-jmx-mx4j.xml for a non JVM server solution            -->
    11 <!-- =============================================================== -->
    12 <Configure id="Server" class="org.mortbay.jetty.Server">
     12  <!-- =========================================================== -->
     13  <!-- Set the java.rmi.server.hostname property in case you've    -->
     14  <!-- got a misconfigured /etc/hosts entry or the like.           -->
     15  <!-- =========================================================== -->
     16  <!--
     17  <Call class="java.lang.System" name="setProperty">
     18    <Arg>java.rmi.server.hostname</Arg>
     19    <Arg>127.0.0.1</Arg>
     20  </Call>
     21  -->
     22 
     23  <!-- =========================================================== -->
     24  <!-- Initialize an mbean server                                  -->
     25  <!-- =========================================================== -->
     26  <Call id="MBeanServer" class="java.lang.management.ManagementFactory"
     27    name="getPlatformMBeanServer" />
    1328
    14     <!-- =========================================================== -->
    15     <!-- Initialize an mbean server                                  -->
    16     <!-- =========================================================== -->
    17     <!-- Use the jdk 1.5 platformMBeanServer -->
    18     <Call id="MBeanServer" class="java.lang.management.ManagementFactory" name="getPlatformMBeanServer"/>
     29  <!-- =========================================================== -->
     30  <!-- Initialize the Jetty MBean container                        -->
     31  <!-- =========================================================== -->
     32  <New id="MBeanContainer" class="org.eclipse.jetty.jmx.MBeanContainer">
     33    <Arg><Ref id="MBeanServer" /></Arg>
     34    <Call name="start"/>
     35  </New>
    1936
    20     <!-- =========================================================== -->
    21     <!-- Initialize the Jetty MBean container                        -->
    22     <!-- =========================================================== -->
    23     <Get id="Container" name="container">
    24       <Call name="addEventListener">
    25         <Arg>
    26           <New class="org.mortbay.management.MBeanContainer">
    27             <Arg><Ref id="MBeanServer"/></Arg>
    28             <Call name="start" />
    29           </New>
    30         </Arg>
    31       </Call>
    32     </Get>
     37  <!-- Add to the Server to listen for object events -->
     38  <Get id="Container" name="container">
     39    <Call name="addEventListener">
     40      <Arg><Ref id="MBeanContainer" /></Arg>
     41    </Call>
     42  </Get>
    3343
    34     <!-- =========================================================== -->
    35     <!-- Enable stats (why else are you using JMX?                                -->
    36     <!-- Sneakily replace the top-level handler with a StatisticsHandler          -->
    37     <!-- Note we could use AtomicStatisticsHandler in jetty-java5-stats.jar (4KB) -->
    38     <!-- but it really isn't worth bundling it.                                   -->
    39     <!-- http://blog.markfeeney.com/2010/10/jmx-statistics-in-jetty-6-6122.html   -->
    40     <!-- =========================================================== -->
    41     <Get id="oldhandler" name="handler"/>
    42     <Set name="handler">
    43       <New id="StatsHandler" class="org.mortbay.jetty.handler.StatisticsHandler">
    44         <Set name="handler"><Ref id="oldhandler"/></Set>
     44  <!-- Add to the Server as a managed lifecycle -->
     45  <Call name="addBean">
     46    <Arg><Ref id="MBeanContainer"/></Arg>
     47    <Arg type="boolean">true</Arg>
     48  </Call>
     49
     50  <!-- Add the static log -->
     51  <Ref id="MBeanContainer">
     52    <Call name="addBean">
     53      <Arg>
     54        <New class="org.eclipse.jetty.util.log.Log"/>
     55      </Arg>
     56    </Call>
     57  </Ref>
     58 
     59  <!-- In order to connect to the JMX server remotely from a different
     60       process, possibly running on a different host, Jetty JMX module
     61       can create a remote JMX connector. It requires RMI registry to
     62       be started prior to creating the connector server because the
     63       JMX specification uses RMI to facilitate connections.       
     64   -->
     65
     66  <!-- Optionally start the RMI registry. Normally RMI registry runs on
     67       port 1099. The argument below can be changed in order to comply
     68       with the firewall requirements.
     69  -->
     70  <!--
     71  <Call name="createRegistry" class="java.rmi.registry.LocateRegistry">
     72    <Arg type="java.lang.Integer"><SystemProperty name="jetty.jmxrmiport" default="1099"/></Arg>
     73    <Call name="sleep" class="java.lang.Thread">
     74       <Arg type="java.lang.Integer">1000</Arg>
     75    </Call>
     76  </Call>
     77  -->
     78 
     79  <!-- Optionally add a remote JMX connector. The parameters of the constructor
     80       below specify the JMX service URL, and the object name string for the
     81       connector server bean. The parameters of the JMXServiceURL constructor
     82       specify the protocol that clients will use to connect to the remote JMX
     83       connector (RMI), the hostname of the server (local hostname), port number
     84       (automatically assigned), and the URL path. Note that URL path contains
     85       the RMI registry hostname and port number, that may need to be modified
     86       in order to comply with the firewall requirements.
     87  -->
     88  <!--
     89  <New id="ConnectorServer" class="org.eclipse.jetty.jmx.ConnectorServer">
     90    <Arg>
     91      <New class="javax.management.remote.JMXServiceURL">
     92        <Arg type="java.lang.String">rmi</Arg>
     93        <Arg type="java.lang.String" />
     94        <Arg type="java.lang.Integer"><SystemProperty name="jetty.jmxrmiport" default="1099"/></Arg>
     95        <Arg type="java.lang.String">/jndi/rmi://<SystemProperty name="jetty.jmxrmihost" default="localhost"/>:<SystemProperty name="jetty.jmxrmiport" default="1099"/>/jmxrmi</Arg>
    4596      </New>
    46     </Set>
    47 
    48 
    49     <!--
    50     When setting up the JMXConnectorServer via RMI, two TCP ports are used to communicate with
    51     the remote server:
    52     * the rmiregistry port (by default 1099) from where the RMI stub is downloaded
    53     * the rmi server port (by default randomly chosen) where the actual RMI communication happens
    54     The JMXServiceURL for the default configuration is therefore:
    55 
    56     service:jmx:rmi:///jndi/rmi://<remotehost>:1099/jmxrmi
    57 
    58     In case a firewall is restricting port access, you need to make sure that the rmi server port
    59     is not chosen randomly, and this can be specified with the following JMXServiceURL:
    60 
    61     service:jmx:rmi://<host>:2100/jndi/rmi://<host>:2099/jmxrmi
    62 
    63     where 2099 is the rmiregistry port and 2100 is the rmi server port.
    64     Make sure the firewall allow access to those ports.
    65 
    66     When using the XML configuration below, you don't need to specify any of the JMX system properties
    67     on the command line (see http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html).
    68     -->
    69 
    70     <!-- Setup the RMIRegistry on a specific port
    71     <Call id="rmiRegistry" class="java.rmi.registry.LocateRegistry" name="createRegistry">
    72       <Arg type="int">2099</Arg>
    73     </Call>
    74     -->
    75     <!-- Setup the JMXConnectorServer on a specific rmi server port
    76     <Call id="jmxConnectorServer" class="javax.management.remote.JMXConnectorServerFactory" name="newJMXConnectorServer">
    77       <Arg>
    78         <New  class="javax.management.remote.JMXServiceURL">
    79           <Arg>service:jmx:rmi://localhost:2100/jndi/rmi://localhost:2099/jmxrmi</Arg>
    80         </New>
    81       </Arg>
    82       <Arg/>
    83       <Arg><Ref id="MBeanServer"/></Arg>
    84       <Call name="start"/>
    85     </Call>
    86     -->
    87 
     97    </Arg>
     98    <Arg>org.eclipse.jetty.jmx:name=rmiconnectorserver</Arg>
     99    <Call name="start" />
     100  </New>
     101  -->
    88102</Configure>
    89103
  • installer/resources/eepsite/jetty-rewrite.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0"?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
    44<!-- =============================================================== -->
     
    77
    88
    9 <Configure id="Server" class="org.mortbay.jetty.Server">
     9<Configure id="Server" class="org.eclipse.jetty.server.Server">
    1010
    1111    <!-- =========================================================== -->
    12     <!-- Configure Rewrite Handler                                   -->
     12    <!-- configure rewrite handler                                   -->
    1313    <!-- =========================================================== -->
    1414    <Get id="oldhandler" name="handler"/>
    1515
    1616    <Set name="handler">
    17      <New id="Rewrite" class="org.mortbay.jetty.handler.rewrite.RewriteHandler">
    18      
     17     <New id="Rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
    1918      <Set name="handler"><Ref id="oldhandler"/></Set>
    2019      <Set name="rewriteRequestURI">true</Set>
     
    2221      <Set name="originalPathAttribute">requestedPath</Set>
    2322
    24       <Set name="rules">
    25           <Array type="org.mortbay.jetty.handler.rewrite.Rule">
     23      <!-- Add rule to protect against IE ssl bug -->
     24      <Call name="addRule">
     25        <Arg>
     26          <New class="org.eclipse.jetty.rewrite.handler.MsieSslRule"/>
     27        </Arg>
     28      </Call>
    2629
    27            <!-- return an error message if low on threads; put this at the top so it will be processed first -->
    28            <Item>
    29              <New id="lowThreads" class="org.mortbay.jetty.handler.rewrite.LowThreadsRuleContainer">               
    30                 <!-- set the trigger for low threads ridiculously low
    31                 uncomment the block below to see it in action -->
    32                 <!--Ref id="Server">
    33                   <Get id="serverThreadPool" name="threadPool">
    34                     <Set name="minThreads">3</Set>
    35                     <Set name="maxThreads">4</Set>
    36                     <Set name="lowThreads">0</Set>
    37                   </Get>
    38                 </Ref>
     30      <!-- protect favicon handling -->
     31      <Call name="addRule">
     32        <Arg>
     33          <New class="org.eclipse.jetty.rewrite.handler.HeaderPatternRule">
     34            <Set name="pattern">/favicon.ico</Set>
     35            <Set name="name">Cache-Control</Set>
     36            <Set name="value">Max-Age=3600,public</Set>
     37            <Set name="terminating">true</Set>
     38          </New>
     39        </Arg>
     40      </Call>
    3941
    40                 <Set name="threadPool"><Ref id="serverThreadPool"/></Set-->
    41                
    42                 <Call name="addRule">
    43                   <Arg>
    44                     <New id="busyresponse" class="org.mortbay.jetty.handler.rewrite.ResponsePatternRule">
    45                         <Set name="pattern">/*</Set>
    46                         <Set name="code">500</Set>
    47                         <Set name="reason">Server busy</Set>
    48                    </New>
    49                   </Arg>
    50                 </Call>
    51              </New>
    52            </Item>
     42      <!-- redirect from the welcome page to a specific page -->
     43      <Call name="addRule">
     44        <Arg>
     45          <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
     46            <Set name="pattern">/rewrite/</Set>
     47            <Set name="replacement">/rewrite/info.html</Set>
     48          </New>
     49        </Arg>
     50      </Call>
    5351
    54             <!-- Add rule to protect against IE ssl bug -->
    55             <Item>
    56               <New class="org.mortbay.jetty.handler.rewrite.MsieSslRule"/>
    57             </Item>
     52      <!-- replace the entire request URI -->
     53      <Call name="addRule">
     54        <Arg>
     55          <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
     56            <Set name="pattern">/some/old/context</Set>
     57            <Set name="replacement">/rewritten/newcontext</Set>
     58          </New>
     59        </Arg>
     60      </Call>
    5861
    59             <!-- protect favicon handling -->
    60             <Item>
    61               <New class="org.mortbay.jetty.handler.rewrite.HeaderPatternRule">
    62                 <Set name="pattern">/favicon.ico</Set>
    63                 <Set name="name">Cache-Control</Set>
    64                 <Set name="value">Max-Age=3600,public</Set>
    65                 <Set name="terminating">true</Set>
    66               </New>
    67             </Item>
     62      <!-- replace the beginning of the request URI -->
     63      <Call name="addRule">
     64        <Arg>
     65          <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
     66            <Set name="pattern">/rewrite/for/*</Set>
     67            <Set name="replacement">/rewritten/</Set>
     68          </New>
     69        </Arg>
     70      </Call>
     71     
     72      <!-- reverse the order of the path sections -->
     73      <Call name="addRule">
     74        <Arg>
     75          <New class="org.eclipse.jetty.rewrite.handler.RewriteRegexRule">
     76            <Set name="regex">(.*?)/reverse/([^/]*)/(.*)</Set>
     77            <Set name="replacement">$1/reverse/$3/$2</Set>
     78          </New>
     79        </Arg>
     80      </Call>
    6881
     82      <!-- add a cookie to each path visited -->
     83      <Call name="addRule">
     84        <Arg>
     85          <New class="org.eclipse.jetty.rewrite.handler.CookiePatternRule">
     86            <Set name="pattern">/*</Set>
     87            <Set name="name">visited</Set>
     88            <Set name="value">yes</Set>
     89          </New>
     90        </Arg>
     91      </Call>
     92     
     93      <!--  actual redirect, instead of internal rewrite -->
     94      <Call name="addRule">
     95        <Arg>
     96          <New class="org.eclipse.jetty.rewrite.handler.RedirectPatternRule">
     97            <Set name="pattern">/redirect/*</Set>
     98            <Set name="location">/redirected</Set>
     99          </New>
     100        </Arg>
     101      </Call>
    69102
    70             <!-- add a regex rule -->
    71             <Item>
    72               <New class="org.mortbay.jetty.handler.rewrite.RewriteRegexRule">
    73                 <Set name="regex">/rewrite/dump/regex/([^/]*)/(.*)</Set>
    74                 <Set name="replacement">/test/dump/$2/$1</Set>
    75               </New>
    76             </Item>
     103      <!-- add a response rule -->
     104      <Call name="addRule">
     105        <Arg>
     106           <New class="org.eclipse.jetty.rewrite.handler.ResponsePatternRule">
     107             <Set name="pattern">/400Error</Set>
     108             <Set name="code">400</Set>
     109             <Set name="reason">ResponsePatternRule Demo</Set>
     110          </New>
     111        </Arg>
     112      </Call>
    77113
    78             <!-- add a rewrite rule -->
    79             <Item>
    80               <New id="" class="org.mortbay.jetty.handler.rewrite.RewritePatternRule">
    81                 <Set name="pattern">/rewrite</Set>
    82                 <Set name="replacement">/rewrittento</Set>
    83               </New>
    84             </Item>
    85            
    86             <!-- add a response rule -->
    87             <Item>
    88               <New id="response" class="org.mortbay.jetty.handler.rewrite.ResponsePatternRule">
    89                 <Set name="pattern">/rewrite/session/</Set>
    90                 <Set name="code">401</Set>
    91                 <Set name="reason">Setting error code 401</Set>
    92               </New>
    93             </Item>
    94 
    95             <!-- add a header pattern rule -->
    96             <Item>
    97               <New id="header" class="org.mortbay.jetty.handler.rewrite.HeaderPatternRule">
    98                 <Set name="pattern">*.jsp</Set>
    99                 <Set name="name">Server</Set>
    100                 <Set name="value">Server for JSP</Set>
    101               </New>
    102             </Item>
    103 
    104             <!-- add a redirect -->
    105             <Item>
    106               <New id="redirect" class="org.mortbay.jetty.handler.rewrite.RedirectPatternRule">
    107                 <Set name="pattern">/rewrite/dispatch</Set>
    108                 <Set name="location">http://jetty.mortbay.org</Set>
    109               </New>
    110             </Item>
    111 
    112             <Item>
    113               <New id="forwardedHttps" class="org.mortbay.jetty.handler.rewrite.ForwardedSchemeHeaderRule">
    114                 <Set name="header">X-Forwarded-Scheme</Set>
    115                 <Set name="headerValue">https</Set>
    116                 <Set name="scheme">https</Set>
    117               </New>
    118             </Item>
    119 
    120             <Item>
    121               <New id="virtualHost" class="org.mortbay.jetty.handler.rewrite.VirtualHostRuleContainer">
    122 
    123                 <Set name="virtualHosts">
    124                   <Array type="java.lang.String">
    125                     <Item>mortbay.com</Item>
    126                     <Item>www.mortbay.com</Item>
    127                     <Item>mortbay.org</Item>
    128                     <Item>www.mortbay.org</Item>
    129                   </Array>
    130                 </Set>
    131 
    132                 <Call name="addRule">
    133                   <Arg>
    134                     <New class="org.mortbay.jetty.handler.rewrite.CookiePatternRule">
    135                       <Set name="pattern">/*</Set>
    136                       <Set name="name">CookiePatternRule</Set>
    137                       <Set name="value">1</Set>
    138                     </New>
    139                   </Arg>
    140                 </Call>
    141      
    142              </New>
    143            </Item>           
    144           </Array>
    145         </Set>
    146       </New>
     114     </New>
    147115    </Set>
    148116   
  • installer/resources/eepsite/jetty-ssl.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0"?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
    44<!-- =============================================================== -->
     
    66<!-- this configuration file should be used in combination with      -->
    77<!-- other configuration files.  e.g.                                -->
    8 <!--    java -jar start.jar etc/jetty.xml etc/jetty-ssl.xml          -->
     8<!--    java -jar start.jar etc/jetty-ssl.xml                        -->
     9<!--                                                                 -->
     10<!--  alternately, add to the start.ini for easier usage             -->
    911<!-- =============================================================== -->
    10 <Configure id="Server" class="org.mortbay.jetty.Server">
     12<Configure id="Server" class="org.eclipse.jetty.server.Server">
    1113
    12 
     14  <!-- if NIO is not available, use org.eclipse.jetty.server.ssl.SslSocketConnector -->
     15 
     16  <New id="sslContextFactory" class="org.eclipse.jetty.http.ssl.SslContextFactory">
     17    <Set name="KeyStore">./eepsite/etc/keystore</Set>
     18    <Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
     19    <Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
     20    <Set name="TrustStore">./eepsite/etc/keystore</Set>
     21    <Set name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
     22  </New>
    1323
    1424  <Call name="addConnector">
    1525    <Arg>
    16       <New class="org.mortbay.jetty.security.SslSocketConnector">
     26      <New class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
     27        <Arg><Ref id="sslContextFactory" /></Arg>
    1728        <Set name="Port">8443</Set>
    1829        <Set name="maxIdleTime">30000</Set>
    1930        <Set name="useDirectBuffers">false</Set>
    20         <Set name="handshakeTimeout">2000</Set>
    21         <Set name="keystore">./eepsite/etc/keystore.ks</Set>
    22         <Set name="password">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
    23         <Set name="keyPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
    24         <Set name="truststore">./eepsite/etc/keystore.ks</Set>
    25         <Set name="trustPassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
    26         <Set name="handshakeTimeout">2000</Set>
    27         <!-- Set name="ThreadPool">
    28           <New class="org.mortbay.thread.QueuedThreadPool">
    29             <Set name="minThreads">0</Set>
    30             <Set name="maxThreads">16</Set>
    31          </New>
    32         </Set -->
     31        <Set name="Acceptors">2</Set>
     32        <Set name="AcceptQueueSize">100</Set>
    3333      </New>
    3434    </Arg>
  • installer/resources/eepsite/jetty.xml

    r4f14677 rf57f49c3  
    11<?xml version="1.0" encoding="UTF-8" ?>
    2 <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">
     2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
    33
    44<!-- ========================================================================= -->
     
    1919<!--   * Uncomment the line to allow Jetty to follow symlinks                  -->
    2020<!--                                                                           -->
    21 <!-- I2P uses Jetty 6.1.26. If you need web server features not found          -->
    22 <!-- in Jetty 6, you may install and run Jetty 7 or 8 in a different JVM       -->
     21<!-- I2P uses Jetty 7. If you need web server features not found               -->
     22<!-- in Jetty 7, you may install and run Jetty 7 or 8 in a different JVM       -->
    2323<!-- or run any other web server such as Apache. If you do run another web     -->
    2424<!-- server instead, be sure and disable the Jetty 6 server for your           -->
     
    4545
    4646
    47 <Configure id="Server" class="org.mortbay.jetty.Server">
     47<Configure id="Server" class="org.eclipse.jetty.server.Server">
    4848
    4949    <!-- =========================================================== -->
     
    5858       -->
    5959     <!--
    60       <New class="org.mortbay.thread.QueuedThreadPool">
     60      <New class="org.eclipse.jetty.util.thread.QueuedThreadPool">
    6161        <Set name="minThreads">1</Set>
    6262        <Set name="maxThreads">16</Set>
     
    7474           See RouterConsoleRunner.
    7575       -->
    76       <New class="org.mortbay.thread.concurrent.ThreadPool">
    77         <Arg type="int">0</Arg>
    78         <Set name="corePoolSize">1</Set>
    79         <Set name="maximumPoolSize">24</Set>
     76      <New class="org.eclipse.jetty.util.thread.ExecutorThreadPool">
     77        <!-- corePoolSize (must be at least 3) -->
     78        <Arg type="int">3</Arg>
     79        <!-- maximumPoolSize -->
     80        <Arg type="int">16</Arg>
     81        <!-- keepAliveTime (milliseconds) -->
     82        <Arg type="long">60000</Arg>
    8083      </New>
    8184    </Set>
     
    98101    <Call name="addConnector">
    99102      <Arg>
    100           <New class="org.mortbay.jetty.nio.SelectChannelConnector">
     103          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
    101104            <Set name="host">127.0.0.1</Set>
    102105            <Set name="port">7658</Set>
     
    107110            <Set name="lowResourcesConnections">5000</Set>
    108111            <Set name="lowResourcesMaxIdleTime">5000</Set>
    109             <Set name="useDirectBuffers">false</Set>
     112            <Set name="useDirectBuffers">false</Set>
    110113          </New>
    111114      </Arg>
     
    118121    <Call name="addConnector">
    119122      <Arg>
    120           <New class="org.mortbay.jetty.bio.SocketConnector">
     123          <New class="org.eclipse.jetty.server.bio.SocketConnector">
    121124            <Set name="host">127.0.0.1</Set>
    122125            <Set name="port">7658</Set>
     
    156159    <!--
    157160    <Set name="sessionIdManager">
    158       <New class="org.mortbay.jetty.servlet.HashSessionIdManager">
     161      <New class="org.eclipse.jetty.server.session.HashSessionIdManager">
    159162        <Set name="workerName">node1</Set>
    160163      </New>
     
    166169    <!-- =========================================================== -->
    167170    <Set name="handler">
    168       <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
     171      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
    169172        <Set name="handlers">
    170          <Array type="org.mortbay.jetty.Handler">
     173         <Array type="org.eclipse.jetty.server.Handler">
    171174           <Item>
    172              <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
     175             <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
    173176           </Item>
    174177           <Item>
    175              <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
     178             <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
    176179           </Item>
    177180           <Item>
    178              <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
     181             <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
    179182           </Item>
    180183         </Array>
     
    182185      </New>
    183186    </Set>
    184    
     187
     188    <!-- =============================================================== -->
     189    <!-- Create the deployment manager                                   -->
     190    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
     191    <!-- The deplyment manager handles the lifecycle of deploying web    -->
     192    <!-- applications. Apps are provided by instances of the             -->
     193    <!-- AppProvider interface.  Typically these are provided by         -->
     194    <!-- one or more of:                                                 -->
     195    <!--   jetty-webapps.xml       - monitors webapps for wars and dirs  -->
     196    <!--   jetty-contexts.xml      - monitors contexts for context xml   -->
     197    <!--   jetty-templates.xml     - monitors contexts and templates     -->
     198    <!-- =============================================================== -->
     199    <Call name="addBean">
     200      <Arg>
     201        <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
     202          <Set name="contexts">
     203            <Ref id="Contexts" />
     204          </Set>
     205          <Call name="setContextAttribute">
     206            <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
     207            <Arg>.*/.*jsp-api-[^/]*\.jar$|.*/.*jsp-[^/]*\.jar$|.*/.*taglibs[^/]*\.jar$</Arg>
     208          </Call>
     209        </New>
     210      </Arg>
     211    </Call>
     212
    185213    <!-- =========================================================== -->
    186214    <!-- Configure the context deployer                              -->
     
    194222    <!--                                                             -->
    195223    <!-- =========================================================== -->
    196     <Call name="addLifeCycle">
    197       <Arg>
    198         <New class="org.mortbay.jetty.deployer.ContextDeployer">
    199           <Set name="contexts"><Ref id="Contexts"/></Set>
    200           <Set name="configurationDir">./eepsite/contexts</Set>
    201           <!-- set to 60 to have it check for changes once a minute -->
    202           <Set name="scanInterval">0</Set>
    203         </New>
    204       </Arg>
    205     </Call>
     224    <Ref id="DeploymentManager">
     225      <Call name="addAppProvider">
     226        <Arg>
     227          <New class="org.eclipse.jetty.deploy.providers.ContextProvider">
     228            <Set name="monitoredDirName">./eepsite/contexts</Set>
     229            <Set name="scanInterval">30</Set>
     230          </New>
     231        </Arg>
     232      </Call>
     233    </Ref>
    206234
    207235    <!-- =========================================================== -->
     
    220248    <Call name="addLifeCycle">
    221249      <Arg>
    222         <New class="org.mortbay.jetty.deployer.WebAppDeployer">
     250        <New class="org.eclipse.jetty.deploy.WebAppDeployer">
    223251          <Set name="contexts"><Ref id="Contexts"/></Set>
    224252          <Set name="webAppDir">./eepsite/webapps</Set>
     
    232260    </Call>
    233261
     262<!-- FIXME Above is deprecated, but this doesn't work
     263     java.lang.IllegalStateException: No Method: <Call name="addAppProvider"><New class="org.eclipse.jetty.deploy.providers.WebAppProvider"><Set name="monitoredDirName">./eepsite/webapps</Set><Set name="parentLoaderPriority">false</Set><Set name="extractWars">false</Set><Set name="defaultsDescriptor">./eepsite/etc/webdefault.xml</Set></New></Call> on class org.eclipse.jetty.deploy.DeploymentManager
     264    <Ref id="DeploymentManager">
     265      <Call id="webappprovider" name="addAppProvider">
     266        <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
     267          <Set name="monitoredDirName">./eepsite/webapps</Set>
     268          <Set name="parentLoaderPriority">false</Set>
     269          <Set name="extractWars">false</Set>
     270          <Set name="defaultsDescriptor">./eepsite/etc/webdefault.xml</Set>
     271        </New>
     272      </Call>
     273    </Ref>
     274-->
     275
    234276    <!-- =========================================================== -->
    235277    <!-- Configure Authentication Realms                             -->
     
    241283  <!-- UNCOMMENT TO ACTIVATE
    242284    <Set name="UserRealms">
    243       <Array type="org.mortbay.jetty.security.UserRealm">
     285      <Array type="org.eclipse.jetty.security.LoginService">
    244286        <Item>
    245           <New class="org.mortbay.jetty.security.HashUserRealm">
     287          <New class="org.eclipse.jetty.security.HashLoginService">
    246288            <Set name="name">Test Realm</Set>
    247289            <Set name="config">./eepsite/etc/realm.properties</Set>
  • router/java/src/net/i2p/router/Router.java

    r4f14677 rf57f49c3  
    129129        // The default is true, unfortunately it was previously
    130130        // set to false in wrapper.config thru 0.7.10 so we must set it back here.
    131         System.setProperty("org.mortbay.util.FileResource.checkAliases", "true");
     131        // Not in Jetty 7
     132        //System.setProperty("org.mortbay.util.FileResource.checkAliases", "true");
    132133    }
    133134   
  • router/java/src/net/i2p/router/startup/MigrateJetty.java

    r4f14677 rf57f49c3  
    3636abstract class MigrateJetty {
    3737    private static boolean _wasChecked;
    38     private static boolean _hasJetty6;
     38    private static boolean _hasLatestJetty;
    3939
    4040    private static final String OLD_CLASS = "org.mortbay.jetty.Server";
    41     private static final String NEW_CLASS = "org.mortbay.start.Main";
    42     private static final String BACKUP = "jetty5.xml";
    43     private static final String JETTY6_TEMPLATE_DIR = "eepsite-jetty6";
    44     private static final String JETTY6_TEMPLATE_PKGDIR = "eepsite";
     41    private static final String OLD_CLASS_6 = "org.mortbay.start.Main";
     42    private static final String NEW_CLASS = "net.i2p.jetty.JettyStart";
     43    private static final String TEST_CLASS = "org.eclipse.jetty.server.Server";
     44    private static final String BACKUP = "jetty6.xml";
     45    private static final String JETTY_TEMPLATE_DIR = "eepsite-jetty7";
     46    private static final String JETTY_TEMPLATE_PKGDIR = "eepsite";
    4547    private static final String BASE_CONTEXT = "contexts/base-context.xml";
    4648    private static final String CGI_CONTEXT = "contexts/cgi-context.xml";
     
    5052        for (int i = 0; i < apps.size(); i++) {
    5153            ClientAppConfig app = apps.get(i);
    52             if (!app.className.equals(OLD_CLASS))
     54            if (!(app.className.equals(OLD_CLASS) || app.className.equals(OLD_CLASS_6)))
    5355                continue;
    5456            String client = "client application " + i + " [" + app.clientName +
    55                             "] from Jetty 5 " + OLD_CLASS +
    56                             " to Jetty 6 " + NEW_CLASS;
    57             if (!hasJetty6()) {
    58                 System.err.println("WARNING: Jetty 6 unavailable, cannot migrate " + client);
     57                            "] from Jetty 5/6 " + app.className +
     58                            " to Jetty 7 " + NEW_CLASS;
     59            if (!hasLatestJetty()) {
     60                System.err.println("WARNING: Jetty 7 unavailable, cannot migrate " + client);
    5961                continue;
    6062            }
     
    8486                continue;
    8587            }
    86             File baseEep = new File(ctx.getBaseDir(), JETTY6_TEMPLATE_DIR);
     88            File baseEep = new File(ctx.getBaseDir(), JETTY_TEMPLATE_DIR);
    8789            // in packages, or perhaps on an uninstall/reinstall, the files are in eepsite/
    8890            if (!baseEep.exists())
    89                 baseEep = new File(ctx.getBaseDir(), JETTY6_TEMPLATE_PKGDIR);
     91                baseEep = new File(ctx.getBaseDir(), JETTY_TEMPLATE_PKGDIR);
    9092            if (baseEep.equals(eepsite)) {
    9193                // non-split directory yet not an upgrade? shouldn't happen
     
    133135        if (shouldSave) {
    134136            File cfgFile = ClientAppConfig.configFile(ctx);
    135             File backup = new File(cfgFile.getAbsolutePath() + ".jetty5");
     137            File backup = new File(cfgFile.getAbsolutePath() + ".jetty6");
    136138            if (backup.exists())
    137139                backup = new File(cfgFile.getAbsolutePath() + ctx.random().nextInt());
     
    140142                ClientAppConfig.writeClientAppConfig(ctx, apps);
    141143                System.err.println("WARNING: Migrated clients config file " + cfgFile +
    142                                " from Jetty 5 " + OLD_CLASS +
    143                                " to Jetty 6 " + NEW_CLASS + "\n" +
     144                               " from Jetty 5/6 " + OLD_CLASS + '/' + OLD_CLASS_6 +
     145                               " to Jetty 7 " + NEW_CLASS + "\n" +
    144146                               "Your old clients config file was saved as " + backup);
    145147            }
     
    147149    }
    148150
    149     private static boolean hasJetty6() {
     151    /** do we have Jetty 7? */
     152    private static boolean hasLatestJetty() {
    150153        if (!_wasChecked) {
    151154            try {
    152                 LoadClientAppsJob.testClient(NEW_CLASS, null);
    153                 _hasJetty6 = true;
     155                LoadClientAppsJob.testClient(TEST_CLASS, null);
     156                _hasLatestJetty = true;
    154157            } catch (ClassNotFoundException cnfe) {}
    155158            _wasChecked = true;
    156159        }
    157         return _hasJetty6;
     160        return _hasLatestJetty;
    158161    }
    159162}
Note: See TracChangeset for help on using the changeset viewer.