You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
If a project is using the old API WebAppContext.getServerClassMatcher() and then modifies the server classes, those changes are not applied to the WebAppClassloader of the WebAppContext.
This applies to Embedded usage and XML deployables.
If the deployable has, for example ...
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPEConfigure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configureclass="org.eclipse.jetty.ee10.webapp.WebAppContext">
<Setname="contextPath">/demo</Set>
<Setname="war"><Propertyname="jetty.webapps" />/demo.war
</Set>
<Refrefid="Server">
<Callid="lowResourceMonitor"name="getBean">
<Arg>
<Callclass="java.lang.Class"name="forName">
<Arg>org.eclipse.jetty.server.LowResourceMonitor</Arg>
</Call>
</Arg>
</Call>
</Ref>
<Callname="setAttribute">
<Arg>org.eclipse.jetty.server.LowResourceMonitor</Arg>
<Arg>
<Refrefid="lowResourceMonitor" />
</Arg>
</Call>
<!-- tweak what classes from the Server this WebAppContext can see -->
<Getname="serverClassMatcher">
<Callname="add">
<!-- needed for all example servlets to actually see LowResourceMonitor -->
<Arg>-org.eclipse.jetty.server.LowResourceMonitor</Arg>
</Call>
<Callname="add">
<!-- needed for example servlets that use Server.getBean(). FromBaseRequestServlet and FromRequestAttributeChannelServlet and FromRequestAttributeConnectionServlet -->
<Arg>-org.eclipse.jetty.server.Server</Arg>
</Call>
<Callname="add">
<!-- needed for FromBaseRequestServlet -->
<Arg>-org.eclipse.jetty.server.Request</Arg>
</Call>
</Get>
</Configure>
These changes are not applied to the WebAppClassloader.
To work, the project needs the following change.
diff --git a/standalone/lowresource-access/webapps/demo.xml b/standalone/lowresource-access/webapps/demo.xml
index c5cf4dc..4752183 100644
--- a/standalone/lowresource-access/webapps/demo.xml+++ b/standalone/lowresource-access/webapps/demo.xml@@ -20,7 +20,7 @@
</Arg>
</Call>
<!-- tweak what classes from the Server this WebAppContext can see -->
- <Get name="serverClassMatcher">+ <Get name="hiddenClassMatcher">
<Call name="add">
<!-- needed for all example servlets to actually see LowResourceMonitor -->
<Arg>-org.eclipse.jetty.server.LowResourceMonitor</Arg>
Jetty version(s)
12.0.9
Jetty Environment
ee10 (but could be more)
Java version/vendor
(use: java -version)
Any
OS type/version
Any
Description
If a project is using the old API
WebAppContext.getServerClassMatcher()
and then modifies the server classes, those changes are not applied to the WebAppClassloader of the WebAppContext.This applies to Embedded usage and XML deployables.
If the deployable has, for example ...
These changes are not applied to the WebAppClassloader.
To work, the project needs the following change.
The project at https://github.com/jetty/jetty-examples/tree/12.0.x/standalone/lowresource-access can be used as an example.
Note: you will need to revert the commit jetty/jetty-examples@14d5c89 to replicate this bug.
The text was updated successfully, but these errors were encountered: