Skip to content

Commit

Permalink
HADOOP-10075. Update jetty dependency to version 9 (rkanter)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkanter committed Oct 27, 2016
1 parent 9e03ee5 commit 5877f20
Show file tree
Hide file tree
Showing 143 changed files with 6,868 additions and 1,161 deletions.
20 changes: 10 additions & 10 deletions hadoop-client/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId> <artifactId>commons-logging-api</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>jetty</groupId> <groupId>jetty</groupId>
<artifactId>org.mortbay.jetty</artifactId> <artifactId>org.eclipse.jetty</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty</artifactId> <artifactId>jetty-server</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId> <artifactId>jetty-util</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>servlet-api-2.5</artifactId> <artifactId>servlet-api-2.5</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
Expand Down Expand Up @@ -112,8 +112,8 @@
<artifactId>avro</artifactId> <artifactId>avro</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty</artifactId> <artifactId>jetty-server</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>com.sun.jersey</groupId> <groupId>com.sun.jersey</groupId>
Expand All @@ -125,7 +125,7 @@
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
Expand All @@ -137,7 +137,7 @@
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>org.apache.hadoop</groupId> <groupId>org.apache.hadoop</groupId>
Expand Down
2 changes: 1 addition & 1 deletion hadoop-common-project/hadoop-auth-examples/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,7 +139,19 @@ public void setStatus(int sc) {
status = sc; status = sc;
} }


/**
* Calls setStatus(int sc, String msg) on the wrapped
* {@link HttpServletResponseWrapper} object.
*
* @param sc the status code
* @param msg the status message
* @deprecated {@link HttpServletResponseWrapper#setStatus(int, String)} is
* deprecated. To set a status code use {@link #setStatus(int)}, to send an
* error with a description use {@link #sendError(int, String)}
*/
@Override @Override
@Deprecated
@SuppressWarnings("deprecation")
public void setStatus(int sc, String msg) { public void setStatus(int sc, String msg) {
super.setStatus(sc, msg); super.setStatus(sc, msg);
status = sc; status = sc;
Expand Down
13 changes: 9 additions & 4 deletions hadoop-common-project/hadoop-auth/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId> <artifactId>jetty-util</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty</artifactId> <artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
Expand All @@ -74,7 +79,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@
import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.mortbay.jetty.Server; import org.eclipse.jetty.server.Connector;
import org.mortbay.jetty.servlet.Context; import org.eclipse.jetty.server.Server;
import org.mortbay.jetty.servlet.FilterHolder; import org.eclipse.jetty.server.ServerConnector;
import org.mortbay.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.FilterHolder;

import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

import javax.servlet.DispatcherType;
import javax.servlet.FilterConfig; import javax.servlet.FilterConfig;
import javax.servlet.ServletException; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
Expand All @@ -53,6 +56,7 @@
import java.net.ServerSocket; import java.net.ServerSocket;
import java.net.URL; import java.net.URL;
import java.security.Principal; import java.security.Principal;
import java.util.EnumSet;
import java.util.Properties; import java.util.Properties;


import org.junit.Assert; import org.junit.Assert;
Expand All @@ -63,7 +67,7 @@ public class AuthenticatorTestCase {
private int port = -1; private int port = -1;
private boolean useTomcat = false; private boolean useTomcat = false;
private Tomcat tomcat = null; private Tomcat tomcat = null;
Context context; ServletContextHandler context;


private static Properties authenticatorConfig; private static Properties authenticatorConfig;


Expand Down Expand Up @@ -121,16 +125,19 @@ protected void start() throws Exception {
} }


protected void startJetty() throws Exception { protected void startJetty() throws Exception {
server = new Server(0); server = new Server();
context = new Context(); context = new ServletContextHandler();
context.setContextPath("/foo"); context.setContextPath("/foo");
server.setHandler(context); server.setHandler(context);
context.addFilter(new FilterHolder(TestFilter.class), "/*", 0); context.addFilter(new FilterHolder(TestFilter.class), "/*",
EnumSet.of(DispatcherType.REQUEST));
context.addServlet(new ServletHolder(TestServlet.class), "/bar"); context.addServlet(new ServletHolder(TestServlet.class), "/bar");
host = "localhost"; host = "localhost";
port = getLocalPort(); port = getLocalPort();
server.getConnectors()[0].setHost(host); ServerConnector connector = new ServerConnector(server);
server.getConnectors()[0].setPort(port); connector.setHost(host);
connector.setPort(port);
server.setConnectors(new Connector[] {connector});
server.start(); server.start();
System.out.println("Running embedded servlet container at: http://" + host + ":" + port); System.out.println("Running embedded servlet container at: http://" + host + ":" + port);
} }
Expand Down
34 changes: 28 additions & 6 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -93,24 +93,34 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty</artifactId> <artifactId>jetty-server</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId> <artifactId>jetty-util</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.mortbay.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-sslengine</artifactId> <artifactId>jetty-servlet</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util-ajax</artifactId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>javax.servlet.jsp</groupId> <groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId> <artifactId>jsp-api</artifactId>
Expand Down Expand Up @@ -412,6 +422,18 @@
<output>${project.build.directory}/generated-test-sources/java</output> <output>${project.build.directory}/generated-test-sources/java</output>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>resource-gz</id>
<phase>generate-resources</phase>
<goals>
<goal>resource-gz</goal>
</goals>
<configuration>
<inputDirectory>${basedir}/src/main/webapps/static</inputDirectory>
<outputDirectory>${basedir}/target/webapps/static</outputDirectory>
<extensions>js,css</extensions>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;


import org.mortbay.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.DefaultServlet;


/** /**
* General servlet which is admin-authorized. * General servlet which is admin-authorized.
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Appender; import org.apache.log4j.Appender;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.mortbay.jetty.NCSARequestLog; import org.eclipse.jetty.server.NCSARequestLog;
import org.mortbay.jetty.RequestLog; import org.eclipse.jetty.server.RequestLog;


/** /**
* RequestLog object for use with Http * RequestLog object for use with Http
Expand Down
Loading

0 comments on commit 5877f20

Please sign in to comment.