diff options
Diffstat (limited to 'sonar-application')
5 files changed, 5 insertions, 39 deletions
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index aeee33634ab..c790fecd41e 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -102,10 +102,6 @@ <artifactId>jtds</artifactId> <scope>runtime</scope> </dependency> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-ajp</artifactId> - </dependency> <!-- core plugins --> <dependency> diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 18601529886..c4f3c7b1d8f 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -20,12 +20,6 @@ # Log HTTP requests. Deactivated by default. #sonar.web.jettyRequestLogs: ../../logs/jetty-yyyy_mm_dd.request.log -# Apache mod_jk connector. Supported only in standalone mode. -# Uncomment to activate AJP13 connector. -#sonar.ajp13.host: 0.0.0.0 -#sonar.ajp13.port: 8009 - - #----------------------------------------------------------------------- # DATABASE # diff --git a/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java index 9660553ec65..2bbbbd276e7 100644 --- a/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java +++ b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java @@ -20,10 +20,8 @@ package org.sonar.application; import org.apache.commons.io.FileUtils; -import org.mortbay.jetty.Connector; import org.mortbay.jetty.NCSARequestLog; import org.mortbay.jetty.Server; -import org.mortbay.jetty.ajp.Ajp13SocketConnector; import org.mortbay.jetty.handler.RequestLogHandler; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.webapp.WebAppContext; @@ -44,15 +42,11 @@ public class JettyEmbedder { private final String host; private final int port; private final String contextPath; - private final String ajp13Host; - private final int ajp13Port; - public JettyEmbedder(String host, int port, String contextPath, String ajp13Host, int ajp13Port, URL configurationURL) throws Exception { + public JettyEmbedder(String host, int port, String contextPath, URL configurationURL) throws Exception { this.host = host.trim(); this.port = port; this.contextPath = contextPath; - this.ajp13Host = ajp13Host; - this.ajp13Port = ajp13Port; server = new Server(); if (configurationURL == null) { @@ -62,10 +56,6 @@ public class JettyEmbedder { System.setProperty("jetty.host", this.host); System.setProperty("jetty.port", String.valueOf(port)); System.setProperty("jetty.context", contextPath); - if (ajp13Port > 0) { - System.setProperty("jetty.ajp13Host", this.ajp13Host); - System.setProperty("jetty.ajp13Port", String.valueOf(ajp13Port)); - } XmlConfiguration configuration = new XmlConfiguration(configurationURL); configuration.configure(server); } @@ -75,7 +65,7 @@ public class JettyEmbedder { * for tests */ JettyEmbedder(String host, int port) throws Exception { - this(host, port, null, null, 0, null); + this(host, port, null, null); } public void start() throws Exception { @@ -124,13 +114,6 @@ public class JettyEmbedder { connector.setStatsOn(false); connector.setAcceptors(2); connector.setConfidentialPort(8443); - if (ajp13Port > 0) { - System.out.println("AJP13 connector is on " + ajp13Host + ":" + ajp13Port); - Connector ajpConnector = new Ajp13SocketConnector(); - ajpConnector.setHost(ajp13Host); - ajpConnector.setPort(ajp13Port); - server.addConnector(ajpConnector); - } server.addConnector(connector); server.setStopAtShutdown(true); server.setSendServerVersion(false); diff --git a/sonar-application/src/main/java/org/sonar/application/StartServer.java b/sonar-application/src/main/java/org/sonar/application/StartServer.java index 2d67cc72688..8c2f48181b0 100644 --- a/sonar-application/src/main/java/org/sonar/application/StartServer.java +++ b/sonar-application/src/main/java/org/sonar/application/StartServer.java @@ -30,8 +30,6 @@ public final class StartServer { private static final String DEFAULT_WEB_HOST = "0.0.0.0"; private static final int DEFAULT_WEB_PORT = 9000; private static final String DEFAULT_WEB_CONTEXT = "/"; - private static final String DEFAULT_AJP13_HOST = "0.0.0.0"; - private static final int DEFAULT_AJP13_PORT = -1; private StartServer() { } @@ -44,9 +42,7 @@ public final class StartServer { String host = configuration.getProperty("sonar.web.host", DEFAULT_WEB_HOST); int port = Integer.parseInt(configuration.getProperty("sonar.web.port", "" + DEFAULT_WEB_PORT)); String context = configuration.getProperty("sonar.web.context", DEFAULT_WEB_CONTEXT); - String ajp13Host = configuration.getProperty("sonar.ajp13.host", DEFAULT_AJP13_HOST); - int ajp13Port = Integer.parseInt(configuration.getProperty("sonar.ajp13.port", "" + DEFAULT_AJP13_PORT)); - JettyEmbedder jetty = new JettyEmbedder(host, port, context, ajp13Host, ajp13Port, StartServer.class.getResource("/jetty.xml")); + JettyEmbedder jetty = new JettyEmbedder(host, port, context, StartServer.class.getResource("/jetty.xml")); configureRequestLogs(jetty, configuration); jetty.start(); @@ -83,6 +79,6 @@ public final class StartServer { private static void configureHome() throws URISyntaxException { File confFile = new File(StartServer.class.getResource("/conf/sonar.properties").toURI()); System.setProperty("SONAR_HOME" /* see constant org.sonar.server.platform.SonarHome.PROPERTY */, - confFile.getParentFile().getParentFile().getAbsolutePath()); + confFile.getParentFile().getParentFile().getAbsolutePath()); } } diff --git a/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java b/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java index 91150b888b8..9e79ce86f19 100644 --- a/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java +++ b/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java @@ -30,13 +30,10 @@ public class JettyEmbedderTest { @Test public void xmlConfigurationShouldAccessToSomeSystemProperties() throws Exception { // useful to set the port into the XML file - new JettyEmbedder("127.0.0.1", 9999, "/", "127.0.0.2", 10000, - JettyEmbedderTest.class.getResource("/org/sonar/application/jetty-test.xml")); + new JettyEmbedder("127.0.0.1", 9999, "/", JettyEmbedderTest.class.getResource("/org/sonar/application/jetty-test.xml")); assertEquals("127.0.0.1", System.getProperty("jetty.host")); assertEquals("9999", System.getProperty("jetty.port")); assertEquals("/", System.getProperty("jetty.context")); - assertEquals("127.0.0.2", System.getProperty("jetty.ajp13Host")); - assertEquals("10000", System.getProperty("jetty.ajp13Port")); } @Test |