Skip to content
Permalink
Browse files
CURATOR-630 Upgrade jetty to 9.4.latest (#413)
  • Loading branch information
horvathdora committed Mar 30, 2022
1 parent ab58c4c commit 5ca31e3520189fac3c0447e3083a76756a535723
Showing 6 changed files with 45 additions and 27 deletions.
@@ -92,8 +92,8 @@
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<scope>test</scope>
</dependency>

@@ -40,12 +40,12 @@
import org.apache.curator.x.discovery.server.entity.ServiceNames;
import org.apache.curator.x.discovery.server.mocks.MockServiceDiscovery;
import org.apache.curator.x.discovery.strategies.RandomStrategy;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import java.util.Map;
@@ -90,12 +90,16 @@ public Set<Object> getSingletons()
return singletons;
}
};
ServletContainer container = new ServletContainer(application);
ServletContainer container = new ServletContainer(application);

port = InstanceSpec.getRandomPort();
server = new Server(port);
Context root = new Context(server, "/", Context.SESSIONS);
root.addServlet(new ServletHolder(container), "/*");
ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
root.setContextPath("/");
final ServletHolder servletHolder = new ServletHolder(container);
root.addServlet(servletHolder, "/*");
servletHolder.setInitOrder(1);
server.setHandler(root);
server.start();
}

@@ -38,12 +38,12 @@
import org.apache.curator.x.discovery.server.entity.ServiceNames;
import org.apache.curator.x.discovery.server.mocks.MockServiceDiscovery;
import org.apache.curator.x.discovery.strategies.RandomStrategy;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import java.util.Set;
@@ -87,12 +87,16 @@ public Set<Object> getSingletons()
return singletons;
}
};
ServletContainer container = new ServletContainer(application);
ServletContainer container = new ServletContainer(application);

port = InstanceSpec.getRandomPort();
server = new Server(port);
Context root = new Context(server, "/", Context.SESSIONS);
root.addServlet(new ServletHolder(container), "/*");
ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
root.setContextPath("/");
final ServletHolder servletHolder = new ServletHolder(container);
root.addServlet(servletHolder, "/*");
servletHolder.setInitOrder(1);
server.setHandler(root);
server.start();
}

@@ -39,12 +39,12 @@
import org.apache.curator.x.discovery.server.entity.ServiceNames;
import org.apache.curator.x.discovery.server.mocks.MockServiceDiscovery;
import org.apache.curator.x.discovery.strategies.RandomStrategy;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.MediaType;
import java.util.Set;
@@ -88,12 +88,16 @@ public Set<Object> getSingletons()
return singletons;
}
};
ServletContainer container = new ServletContainer(application);
ServletContainer container = new ServletContainer(application);

port = InstanceSpec.getRandomPort();
server = new Server(port);
Context root = new Context(server, "/", Context.SESSIONS);
root.addServlet(new ServletHolder(container), "/*");
ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
root.setContextPath("/");
final ServletHolder servletHolder = new ServletHolder(container);
root.addServlet(servletHolder, "/*");
servletHolder.setInitOrder(1);
server.setHandler(root);
server.start();
}

@@ -27,15 +27,15 @@
import org.apache.curator.x.discovery.ServiceType;
import org.apache.curator.x.discovery.server.entity.ServiceInstances;
import org.apache.curator.x.discovery.server.entity.ServiceNames;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
import org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.ServletHolder;
import javax.ws.rs.core.MediaType;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
@@ -65,10 +65,16 @@ public void setup() throws Exception

port = InstanceSpec.getRandomPort();
server = new Server(port);
Context root = new Context(server, "/", Context.SESSIONS);

ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
root.setContextPath("/");
root.setServer(server);
root.setContextPath("/");
root.getInitParams().put("javax.ws.rs.Application", RestEasyApplication.class.getName());
root.addServlet(new ServletHolder(dispatcher), "/*");
root.addEventListener(new ResteasyBootstrap());

server.setHandler(root);
server.start();
}

@@ -89,7 +89,7 @@
<!-- See https://stackoverflow.com/questions/43574426#comment93992044_43574427 -->
<jaxb-version>2.2.11</jaxb-version>
<javax-activation-version>1.1.1</javax-activation-version>
<jetty-version>6.1.26</jetty-version>
<jetty-version>9.4.45.v20220203</jetty-version>
<scannotation-version>1.0.2</scannotation-version>
<!-- resteasy-jaxrs dependency cannot be higher than 2.x for compatibility with Jersey 1.x -->
<resteasy-jaxrs-version>2.3.5.Final</resteasy-jaxrs-version>
@@ -510,8 +510,8 @@
</dependency>

<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>${jetty-version}</version>
</dependency>

0 comments on commit 5ca31e3

Please sign in to comment.