From 39ea66368ce28f6219dbef386a857e46454b7b95 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 10 Aug 2017 11:34:13 +1000 Subject: [PATCH 1/4] added assume from running directly --- .../jetty/server/AbstractConnector.java | 99 +++++++++++++------ .../server/AbstractNetworkConnector.java | 11 +-- .../eclipse/jetty/server/ServerConnector.java | 5 +- .../org/eclipse/jetty/util/TypeUtilTest.java | 5 +- 4 files changed, 78 insertions(+), 42 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 232f96ac97f..f9aff946ed6 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -21,6 +21,7 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.net.Socket; import java.nio.ByteBuffer; +import java.nio.channels.ClosedByInterruptException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -34,6 +35,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Condition; import org.eclipse.jetty.io.ArrayByteBufferPool; import org.eclipse.jetty.io.ByteBufferPool; @@ -48,6 +50,7 @@ import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.Locker; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; @@ -137,8 +140,10 @@ import org.eclipse.jetty.util.thread.Scheduler; public abstract class AbstractConnector extends ContainerLifeCycle implements Connector, Dumpable { protected final Logger LOG = Log.getLogger(AbstractConnector.class); - // Order is important on server side, so we use a LinkedHashMap - private final Map _factories = new LinkedHashMap<>(); + + private final Locker _locker = new Locker(); + private final Condition _setAccepting = _locker.newCondition(); + private final Map _factories = new LinkedHashMap<>(); // Order is important on server side, so we use a LinkedHashMap private final Server _server; private final Executor _executor; private final Scheduler _scheduler; @@ -146,12 +151,13 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co private final Thread[] _acceptors; private final Set _endpoints = Collections.newSetFromMap(new ConcurrentHashMap<>()); private final Set _immutableEndPoints = Collections.unmodifiableSet(_endpoints); - private volatile CountDownLatch _stopping; + private CountDownLatch _stopping; private long _idleTimeout = 30000; private String _defaultProtocol; private ConnectionFactory _defaultConnectionFactory; private String _name; private int _acceptorPriorityDelta=-2; + private boolean _accepting = true; /** @@ -283,7 +289,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co protected void interruptAcceptors() { - synchronized (this) + try (Locker.Lock lock = _locker.lockIfNotHeld()) { for (Thread thread : _acceptors) { @@ -327,7 +333,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void join(long timeout) throws InterruptedException { - synchronized (this) + try (Locker.Lock lock = _locker.lock()) { for (Thread thread : _acceptors) if (thread != null) @@ -342,15 +348,31 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co /** * @return Is the connector accepting new connections */ - protected boolean isAccepting() + public boolean isAccepting() { - return isRunning(); + try (Locker.Lock lock = _locker.lock()) + { + return _accepting; + } } + public void setAccepting(boolean accepting) + { + try (Locker.Lock lock = _locker.lock()) + { + _accepting=accepting; + if (accepting) + _setAccepting.signalAll(); + else + interruptAcceptors(); + } + } + + @Override public ConnectionFactory getConnectionFactory(String protocol) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { return _factories.get(StringUtil.asciiToLowerCase(protocol)); } @@ -359,7 +381,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co @Override public T getConnectionFactory(Class factoryType) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { for (ConnectionFactory f : _factories.values()) if (factoryType.isAssignableFrom(f.getClass())) @@ -370,7 +392,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addConnectionFactory(ConnectionFactory factory) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { Set to_remove = new HashSet<>(); for (String key:factory.getProtocols()) @@ -409,7 +431,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addFirstConnectionFactory(ConnectionFactory factory) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { List existings = new ArrayList<>(_factories.values()); _factories.clear(); @@ -422,7 +444,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addIfAbsentConnectionFactory(ConnectionFactory factory) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { String key=StringUtil.asciiToLowerCase(factory.getProtocol()); if (_factories.containsKey(key)) @@ -444,7 +466,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public ConnectionFactory removeConnectionFactory(String protocol) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { ConnectionFactory factory= _factories.remove(StringUtil.asciiToLowerCase(protocol)); removeBean(factory); @@ -455,7 +477,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co @Override public Collection getConnectionFactories() { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { return _factories.values(); } @@ -463,7 +485,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void setConnectionFactories(Collection factories) { - synchronized (_factories) + try (Locker.Lock lock = _locker.lock()) { List existing = new ArrayList<>(_factories.values()); for (ConnectionFactory factory: existing) @@ -538,14 +560,23 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co return getConnectionFactory(_defaultProtocol); } - protected boolean handleAcceptFailure(Throwable previous, Throwable current) + protected boolean handleAcceptFailure(Throwable ex) { - if (isAccepting()) + if (isRunning()) { - if (previous == null) - LOG.warn(current); - else - LOG.debug(current); + if (ex instanceof InterruptedException) + { + LOG.debug(ex); + return true; + } + + if (ex instanceof ClosedByInterruptException) + { + LOG.debug(ex); + return false; + } + + LOG.warn(ex); try { // Arbitrary sleep to avoid spin looping. @@ -556,12 +587,13 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co } catch (Throwable x) { - return false; + LOG.ignore(x); } + return false; } else { - LOG.ignore(current); + LOG.ignore(ex); return false; } } @@ -595,19 +627,28 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co try { - Throwable exception = null; - while (isAccepting()) + while (isRunning()) { + try (Locker.Lock lock = _locker.lock()) + { + if (!_accepting) + { + _setAccepting.await(); + continue; + } + } + catch (InterruptedException e) + { + continue; + } + try { accept(_id); - exception = null; } catch (Throwable x) { - if (handleAcceptFailure(exception, x)) - exception = x; - else + if (!handleAcceptFailure(x)) break; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java index 76bd05ee2c0..3a280cf1371 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java @@ -96,8 +96,7 @@ public abstract class AbstractNetworkConnector extends AbstractConnector impleme @Override public void close() { - // Interrupting is often sufficient to close the channel - interruptAcceptors(); + setAccepting(false); } @@ -107,13 +106,7 @@ public abstract class AbstractNetworkConnector extends AbstractConnector impleme close(); return super.shutdown(); } - - @Override - protected boolean isAccepting() - { - return super.isAccepting() && isOpen(); - } - + @Override public String toString() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java index 6258e171589..c527a2ebdce 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java @@ -344,14 +344,14 @@ public class ServerConnector extends AbstractNetworkConnector @Override public void close() { + super.close(); + ServerSocketChannel serverChannel = _acceptChannel; _acceptChannel = null; - if (serverChannel != null) { removeBean(serverChannel); - // If the interrupt did not close it, we should close it if (serverChannel.isOpen()) { try @@ -364,7 +364,6 @@ public class ServerConnector extends AbstractNetworkConnector } } } - // super.close(); _localPort = -2; } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java index d7085b9c77f..836ffa009e9 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java @@ -27,6 +27,7 @@ import java.nio.file.Paths; import org.eclipse.jetty.toolchain.test.JDK; import org.junit.Assert; +import org.junit.Assume; import org.junit.Test; public class TypeUtilTest @@ -130,7 +131,9 @@ public class TypeUtilTest @Test public void testGetLocationOfClass() throws Exception { - Path mavenRepoPath = Paths.get( System.getProperty( "mavenRepoPath" ) ); + String mavenRepoPathProperty = System.getProperty( "mavenRepoPath"); + Assume.assumeNotNull(mavenRepoPathProperty); + Path mavenRepoPath = Paths.get( mavenRepoPathProperty ); String mavenRepo = mavenRepoPath.toFile().getPath().replaceAll("\\\\", "/"); // Classes from maven dependencies From cf418c639f7fa75fec8560f92806205d829f6dae Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 10 Aug 2017 12:52:28 +1000 Subject: [PATCH 2/4] Revert "added assume from running directly" This reverts commit 39ea66368ce28f6219dbef386a857e46454b7b95. --- .../jetty/server/AbstractConnector.java | 99 ++++++------------- .../server/AbstractNetworkConnector.java | 11 ++- .../eclipse/jetty/server/ServerConnector.java | 5 +- .../org/eclipse/jetty/util/TypeUtilTest.java | 5 +- 4 files changed, 42 insertions(+), 78 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index f9aff946ed6..232f96ac97f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -21,7 +21,6 @@ package org.eclipse.jetty.server; import java.io.IOException; import java.net.Socket; import java.nio.ByteBuffer; -import java.nio.channels.ClosedByInterruptException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -35,7 +34,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.Condition; import org.eclipse.jetty.io.ArrayByteBufferPool; import org.eclipse.jetty.io.ByteBufferPool; @@ -50,7 +48,6 @@ import org.eclipse.jetty.util.component.Dumpable; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.util.thread.Locker; import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; import org.eclipse.jetty.util.thread.Scheduler; @@ -140,10 +137,8 @@ import org.eclipse.jetty.util.thread.Scheduler; public abstract class AbstractConnector extends ContainerLifeCycle implements Connector, Dumpable { protected final Logger LOG = Log.getLogger(AbstractConnector.class); - - private final Locker _locker = new Locker(); - private final Condition _setAccepting = _locker.newCondition(); - private final Map _factories = new LinkedHashMap<>(); // Order is important on server side, so we use a LinkedHashMap + // Order is important on server side, so we use a LinkedHashMap + private final Map _factories = new LinkedHashMap<>(); private final Server _server; private final Executor _executor; private final Scheduler _scheduler; @@ -151,13 +146,12 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co private final Thread[] _acceptors; private final Set _endpoints = Collections.newSetFromMap(new ConcurrentHashMap<>()); private final Set _immutableEndPoints = Collections.unmodifiableSet(_endpoints); - private CountDownLatch _stopping; + private volatile CountDownLatch _stopping; private long _idleTimeout = 30000; private String _defaultProtocol; private ConnectionFactory _defaultConnectionFactory; private String _name; private int _acceptorPriorityDelta=-2; - private boolean _accepting = true; /** @@ -289,7 +283,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co protected void interruptAcceptors() { - try (Locker.Lock lock = _locker.lockIfNotHeld()) + synchronized (this) { for (Thread thread : _acceptors) { @@ -333,7 +327,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void join(long timeout) throws InterruptedException { - try (Locker.Lock lock = _locker.lock()) + synchronized (this) { for (Thread thread : _acceptors) if (thread != null) @@ -348,31 +342,15 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co /** * @return Is the connector accepting new connections */ - public boolean isAccepting() + protected boolean isAccepting() { - try (Locker.Lock lock = _locker.lock()) - { - return _accepting; - } + return isRunning(); } - public void setAccepting(boolean accepting) - { - try (Locker.Lock lock = _locker.lock()) - { - _accepting=accepting; - if (accepting) - _setAccepting.signalAll(); - else - interruptAcceptors(); - } - } - - @Override public ConnectionFactory getConnectionFactory(String protocol) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { return _factories.get(StringUtil.asciiToLowerCase(protocol)); } @@ -381,7 +359,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co @Override public T getConnectionFactory(Class factoryType) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { for (ConnectionFactory f : _factories.values()) if (factoryType.isAssignableFrom(f.getClass())) @@ -392,7 +370,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addConnectionFactory(ConnectionFactory factory) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { Set to_remove = new HashSet<>(); for (String key:factory.getProtocols()) @@ -431,7 +409,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addFirstConnectionFactory(ConnectionFactory factory) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { List existings = new ArrayList<>(_factories.values()); _factories.clear(); @@ -444,7 +422,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void addIfAbsentConnectionFactory(ConnectionFactory factory) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { String key=StringUtil.asciiToLowerCase(factory.getProtocol()); if (_factories.containsKey(key)) @@ -466,7 +444,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public ConnectionFactory removeConnectionFactory(String protocol) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { ConnectionFactory factory= _factories.remove(StringUtil.asciiToLowerCase(protocol)); removeBean(factory); @@ -477,7 +455,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co @Override public Collection getConnectionFactories() { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { return _factories.values(); } @@ -485,7 +463,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void setConnectionFactories(Collection factories) { - try (Locker.Lock lock = _locker.lock()) + synchronized (_factories) { List existing = new ArrayList<>(_factories.values()); for (ConnectionFactory factory: existing) @@ -560,23 +538,14 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co return getConnectionFactory(_defaultProtocol); } - protected boolean handleAcceptFailure(Throwable ex) + protected boolean handleAcceptFailure(Throwable previous, Throwable current) { - if (isRunning()) + if (isAccepting()) { - if (ex instanceof InterruptedException) - { - LOG.debug(ex); - return true; - } - - if (ex instanceof ClosedByInterruptException) - { - LOG.debug(ex); - return false; - } - - LOG.warn(ex); + if (previous == null) + LOG.warn(current); + else + LOG.debug(current); try { // Arbitrary sleep to avoid spin looping. @@ -587,13 +556,12 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co } catch (Throwable x) { - LOG.ignore(x); + return false; } - return false; } else { - LOG.ignore(ex); + LOG.ignore(current); return false; } } @@ -627,28 +595,19 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co try { - while (isRunning()) + Throwable exception = null; + while (isAccepting()) { - try (Locker.Lock lock = _locker.lock()) - { - if (!_accepting) - { - _setAccepting.await(); - continue; - } - } - catch (InterruptedException e) - { - continue; - } - try { accept(_id); + exception = null; } catch (Throwable x) { - if (!handleAcceptFailure(x)) + if (handleAcceptFailure(exception, x)) + exception = x; + else break; } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java index 3a280cf1371..76bd05ee2c0 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNetworkConnector.java @@ -96,7 +96,8 @@ public abstract class AbstractNetworkConnector extends AbstractConnector impleme @Override public void close() { - setAccepting(false); + // Interrupting is often sufficient to close the channel + interruptAcceptors(); } @@ -106,7 +107,13 @@ public abstract class AbstractNetworkConnector extends AbstractConnector impleme close(); return super.shutdown(); } - + + @Override + protected boolean isAccepting() + { + return super.isAccepting() && isOpen(); + } + @Override public String toString() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java index c527a2ebdce..6258e171589 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java @@ -344,14 +344,14 @@ public class ServerConnector extends AbstractNetworkConnector @Override public void close() { - super.close(); - ServerSocketChannel serverChannel = _acceptChannel; _acceptChannel = null; + if (serverChannel != null) { removeBean(serverChannel); + // If the interrupt did not close it, we should close it if (serverChannel.isOpen()) { try @@ -364,6 +364,7 @@ public class ServerConnector extends AbstractNetworkConnector } } } + // super.close(); _localPort = -2; } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java index 836ffa009e9..d7085b9c77f 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java @@ -27,7 +27,6 @@ import java.nio.file.Paths; import org.eclipse.jetty.toolchain.test.JDK; import org.junit.Assert; -import org.junit.Assume; import org.junit.Test; public class TypeUtilTest @@ -131,9 +130,7 @@ public class TypeUtilTest @Test public void testGetLocationOfClass() throws Exception { - String mavenRepoPathProperty = System.getProperty( "mavenRepoPath"); - Assume.assumeNotNull(mavenRepoPathProperty); - Path mavenRepoPath = Paths.get( mavenRepoPathProperty ); + Path mavenRepoPath = Paths.get( System.getProperty( "mavenRepoPath" ) ); String mavenRepo = mavenRepoPath.toFile().getPath().replaceAll("\\\\", "/"); // Classes from maven dependencies From bb39fe600931675a2a28532e8625400081e70fcb Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 10 Aug 2017 12:54:41 +1000 Subject: [PATCH 3/4] improved test for running in IDE --- .../src/test/java/org/eclipse/jetty/util/TypeUtilTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java index d7085b9c77f..3340543be57 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/TypeUtilTest.java @@ -27,6 +27,7 @@ import java.nio.file.Paths; import org.eclipse.jetty.toolchain.test.JDK; import org.junit.Assert; +import org.junit.Assume; import org.junit.Test; public class TypeUtilTest @@ -130,7 +131,10 @@ public class TypeUtilTest @Test public void testGetLocationOfClass() throws Exception { - Path mavenRepoPath = Paths.get( System.getProperty( "mavenRepoPath" ) ); + String mavenRepoPathProperty = System.getProperty( "mavenRepoPath"); + Assume.assumeNotNull(mavenRepoPathProperty); + Path mavenRepoPath = Paths.get( mavenRepoPathProperty ); + String mavenRepo = mavenRepoPath.toFile().getPath().replaceAll("\\\\", "/"); // Classes from maven dependencies From 67d93f9f741e321b2f1990ccbcf191bfbce3be44 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 10 Aug 2017 13:04:31 +1000 Subject: [PATCH 4/4] Issue #1724 --- apache-jsp/pom.xml | 8 ++++++++ .../org/eclipse/jetty/embedded/LikeJettyXml.java | 9 +++++++-- jetty-home/pom.xml | 16 +--------------- jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml index d00dde77d83..48d7244caa5 100644 --- a/apache-jsp/pom.xml +++ b/apache-jsp/pom.xml @@ -89,6 +89,14 @@ ecj + + + org.eclipse.jetty + jetty-annotations + ${project.version} + + + org.eclipse.jetty diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java index 45240b57d37..a43a822410a 100644 --- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java +++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/LikeJettyXml.java @@ -171,7 +171,7 @@ public class LikeJettyXml deployer.setContexts(contexts); deployer.setContextAttribute( "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", - ".*/servlet-api-[^/]*\\.jar$"); + ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$"); WebAppProvider webapp_provider = new WebAppProvider(); webapp_provider.setMonitoredDirName(jetty_base + "/webapps"); @@ -184,10 +184,15 @@ public class LikeJettyXml server.addBean(deployer); // === setup jetty plus == - Configuration.ClassList.setServerDefault(server).addAfter( + Configuration.ClassList classlist = Configuration.ClassList + .setServerDefault( server ); + classlist.addAfter( "org.eclipse.jetty.webapp.FragmentConfiguration", "org.eclipse.jetty.plus.webapp.EnvConfiguration", "org.eclipse.jetty.plus.webapp.PlusConfiguration"); + + classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", + "org.eclipse.jetty.annotations.AnnotationConfiguration"); // === jetty-stats.xml === StatisticsHandler stats = new StatisticsHandler(); diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml index 2379629a38f..360d60c53ff 100644 --- a/jetty-home/pom.xml +++ b/jetty-home/pom.xml @@ -248,7 +248,7 @@ - org.eclipse.jetty,org.eclipse.jetty.toolchain,org.mortbay.jasper,org.eclipse.jetty.orbit,org.eclipse.jdt.core.compiler + org.eclipse.jetty,org.eclipse.jetty.toolchain,org.mortbay.jasper,org.eclipse.jdt.core.compiler apache-jsp,apache-el,ecj jar @@ -256,20 +256,6 @@ ${assembly-directory}/lib/apache-jsp - - copy-jstl-api - generate-resources - - copy-dependencies - - - org.eclipse.jetty.orbit - javax.servlet.jsp.jstl - true - jar - ${assembly-directory}/lib/jsp - - copy-apache-jstl-deps generate-resources diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml index aaddee1b547..7a0bd372d54 100644 --- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml +++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml @@ -31,12 +31,12 @@ org.eclipse.osgi org.eclipse.osgi.services - + javax.servlet javax.servlet-api - + org.eclipse.jetty apache-jsp