Revert "jetty-9 cleaned up serverClasses to minimum"
This reverts commit 67b5caadbb
.
This commit is contained in:
parent
ebd807b904
commit
a0c1d85094
|
@ -14,7 +14,6 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -18,12 +18,6 @@
|
|||
<artifactId>example-async-rest-jar</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
|
|
|
@ -12,7 +12,4 @@ org.eclipse.jetty.servlet.WebApplicationContext object
|
|||
<Get class="org.eclipse.jetty.util.log.Log" name="rootLogger">
|
||||
<Call name="warn"><Arg>async-rest webapp is deployed. DO NOT USE IN PRODUCTION!</Arg></Call>
|
||||
</Get>
|
||||
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.client.</Arg></Call>
|
||||
|
||||
</Configure>
|
||||
|
|
|
@ -33,6 +33,8 @@ public class DemoServer
|
|||
WebAppContext webapp = new WebAppContext();
|
||||
webapp.setContextPath("/");
|
||||
webapp.setWar(jetty_home+"/target/async-rest/");
|
||||
webapp.setParentLoaderPriority(true);
|
||||
webapp.setServerClasses(new String[]{});
|
||||
server.setHandler(webapp);
|
||||
|
||||
server.start();
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
</Arg>
|
||||
</Call> -->
|
||||
|
||||
<Call id="webappProvider" name="addAppProvider">
|
||||
<Call id="webappprovider" name="addAppProvider">
|
||||
<Arg>
|
||||
<New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
|
||||
<Set name="monitoredDirName"><Property name="jetty.home" default="." />/webapps</Set>
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
|
|
|
@ -1854,19 +1854,12 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
|
||||
((WebDescriptor)descriptor).addClassName(className);
|
||||
|
||||
Class<?> listenerClass = context.loadClass(className);
|
||||
if (listenerClass==null)
|
||||
Class<? extends EventListener> listenerClass = (Class<? extends EventListener>)context.loadClass(className);
|
||||
listener = newListenerInstance(context,listenerClass);
|
||||
if (!(listener instanceof EventListener))
|
||||
{
|
||||
throw new RuntimeException("Could not Load EventListener: " + className);
|
||||
}
|
||||
if (!(EventListener.class.isAssignableFrom(listenerClass)))
|
||||
{
|
||||
throw new RuntimeException("Not an EventListener: " + className);
|
||||
}
|
||||
listener = newListenerInstance(context,(Class<? extends EventListener>)listenerClass);
|
||||
if (listener==null)
|
||||
{
|
||||
throw new RuntimeException("Could not Load EventListener: " + className);
|
||||
LOG.warn("Not an EventListener: " + listener);
|
||||
return;
|
||||
}
|
||||
context.addEventListener(listener);
|
||||
context.getMetaData().setOrigin(className+".listener", descriptor);
|
||||
|
@ -1875,7 +1868,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new RuntimeException("Could not instantiate listener " + className, e);
|
||||
LOG.warn("Could not instantiate listener " + className, e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,14 +104,18 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
|
||||
// System classes are classes that cannot be replaced by
|
||||
// the web application, and they are *always* loaded via
|
||||
// system classloader if possible
|
||||
// system classloader.
|
||||
public final static String[] __dftSystemClasses =
|
||||
{
|
||||
"java.", // Java SE classes (per servlet spec v2.5 / SRV.9.7.2)
|
||||
"javax.", // Java SE classes (per servlet spec v2.5 / SRV.9.7.2)
|
||||
"org.xml.", // needed by javax.xml
|
||||
"org.w3c.", // needed by javax.xml
|
||||
"org.eclipse.jetty.", // webapp cannot change jetty classes
|
||||
"org.eclipse.jetty.continuation.", // webapp cannot change continuation classes
|
||||
"org.eclipse.jetty.jndi.", // webapp cannot change naming classes
|
||||
"org.eclipse.jetty.jaas.", // webapp cannot change jaas classes
|
||||
"org.eclipse.jetty.websocket.", // WebSocket is a jetty extension
|
||||
"org.eclipse.jetty.servlet.DefaultServlet" // webapp cannot change default servlets
|
||||
} ;
|
||||
|
||||
// Server classes are classes that are hidden from being
|
||||
|
@ -120,8 +124,12 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
// it has to include them in its distribution.
|
||||
public final static String[] __dftServerClasses =
|
||||
{
|
||||
"-org.eclipse.jetty.servlet.listener.", // don't hide listeners use in webdefault.xml
|
||||
"-org.eclipse.jetty.continuation.", // don't hide continuation classes
|
||||
"-org.eclipse.jetty.jndi.", // don't hide naming classes
|
||||
"-org.eclipse.jetty.jaas.", // don't hide jaas classes
|
||||
"-org.eclipse.jetty.servlets.", // don't hide jetty servlets
|
||||
"-org.eclipse.jetty.servlet.DefaultServlet", // don't hide default servlet
|
||||
"-org.eclipse.jetty.servlet.listener.", // don't hide useful listeners
|
||||
"org.eclipse.jetty." // hide other jetty classes
|
||||
} ;
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>test-jetty-webapp</artifactId>
|
||||
<name>Test :: Jetty Test Webapp</name>
|
||||
<packaging>war</packaging>
|
||||
|
@ -184,7 +183,20 @@
|
|||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
|
@ -200,7 +212,20 @@
|
|||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-io</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
|
|
|
@ -11,9 +11,6 @@ org.eclipse.jetty.servlet.WebApplicationContext object
|
|||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.util.</Arg></Call>
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.servlets.</Arg></Call>
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.websocket.</Arg></Call>
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.servlets.</Arg></Call>
|
||||
<Call name="prependServerClass"><Arg>-org.eclipse.jetty.servlet.listener.</Arg></Call>
|
||||
<Get class="org.eclipse.jetty.util.log.Log" name="rootLogger">
|
||||
<Call name="warn"><Arg>test webapp is deployed. DO NOT USE IN PRODUCTION!</Arg></Call>
|
||||
</Get>
|
||||
|
|
|
@ -67,7 +67,7 @@ public class TestServer
|
|||
{
|
||||
((StdErrLog)Log.getLog()).setSource(false);
|
||||
|
||||
String jetty_root = "../../..";
|
||||
String jetty_root = "..";
|
||||
|
||||
// Setup Threadpool
|
||||
QueuedThreadPool threadPool = new QueuedThreadPool();
|
||||
|
@ -153,7 +153,7 @@ public class TestServer
|
|||
|
||||
HashLoginService login = new HashLoginService();
|
||||
login.setName("Test Realm");
|
||||
login.setConfig(jetty_root + "/tests/test-webapps/test-jetty-webapp/src/main/config/etc/realm.properties");
|
||||
login.setConfig(jetty_root + "/test-jetty-webapp/src/main/config/etc/realm.properties");
|
||||
server.addBean(login);
|
||||
|
||||
File log=File.createTempFile("jetty-yyyy_mm_dd", "log");
|
||||
|
@ -165,8 +165,8 @@ public class TestServer
|
|||
server.setSendServerVersion(true);
|
||||
|
||||
WebAppContext webapp = new WebAppContext();
|
||||
// webapp.setParentLoaderPriority(true);
|
||||
// webapp.prependServerClass("-org.eclipse.jetty.websocket.server.");
|
||||
webapp.setParentLoaderPriority(true);
|
||||
webapp.prependServerClass("-org.eclipse.jetty.websocket.server.");
|
||||
webapp.setResourceBase("./src/main/webapp");
|
||||
webapp.setAttribute("testAttribute","testValue");
|
||||
File sessiondir=File.createTempFile("sessions",null);
|
||||
|
|
Loading…
Reference in New Issue