Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start properties jetty.webapp.addServerClasses and jetty.webapp.addSystemClasses are not applied during ee8/ee9 deployments #11514

Closed
joakime opened this issue Mar 13, 2024 · 1 comment
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Mar 13, 2024

Jetty version(s)
12.0.7

Jetty Environment
ee8 / ee9

Java version/vendor (use: java -version)
Any

OS type/version
Any

Description
If you setup an jetty.base with a jetty.webapp.addServerClasses (or jetty.webapp.addSystemClasses), then those properties do not get reflected in the ee9 / ee8 environments (it does work for the ee10 environments)

How to reproduce?

Setup a fresh jetty.base with the ee9-demos ...

$ mkdir demos-12-ee9
$ cd demos-12-ee9
$ java -jar ../../jetty-home-12.0.7/start.jar --add-module=http,ee9-deploy,ee9-demos
$ java -jar ../../jetty-home-12.0.7/start.jar --list-config | grep addServer
 jetty.webapp.addServerClasses = org.eclipse.jetty.logging.,${jetty.home.uri}/lib/logging/,org.slf4j.,${jetty.base.uri}/lib/bouncycastle/

Notice that we have a addServerClasses with the org.eclipse.jetty.logging. entry.

Now run with the server dump and look for the Serverclasses entries

$ java -jar ../../jetty-home-12.0.7/start.jar jetty.server.dumpAfterStart=true
|        |  +> Serverclasses EE9 Demo JSP WebApp@2ba5aa7a size=20
|        |  |  +> -org.eclipse.jetty.ee9.apache.
|        |  |  +> -org.eclipse.jetty.ee9.jsp.
|        |  |  +> -org.eclipse.jetty.ee9.servlet.DefaultServlet
|        |  |  +> -org.eclipse.jetty.ee9.servlet.NoJspServlet
|        |  |  +> -org.eclipse.jetty.ee9.servlet.StatisticsServlet
|        |  |  +> -org.eclipse.jetty.ee9.servlet.listener.
|        |  |  +> -org.eclipse.jetty.ee9.servlets.
|        |  |  +> -org.eclipse.jetty.ee9.websocket.api.
|        |  |  +> -org.eclipse.jetty.ee9.websocket.jakarta.client.JakartaWebSocketClientContainerProvider
|        |  |  +> -org.eclipse.jetty.ee9.websocket.jakarta.client.JakartaWebSocketShutdownContainer
|        |  |  +> -org.eclipse.jetty.ee9.websocket.jakarta.server.config.
|        |  |  +> -org.eclipse.jetty.ee9.websocket.server.
|        |  |  +> -org.eclipse.jetty.ee9.websocket.servlet.
|        |  |  +> -org.eclipse.jetty.jndi.
|        |  |  +> -org.eclipse.jetty.security.jaas.
|        |  |  +> org.eclipse.jdt.
|        |  |  +> org.eclipse.jetty.
|        |  |  +> org.eclipse.jetty.server.config.
|        |  |  +> org.eclipse.jetty.server.internal.
|        |  |  +> org.objectweb.asm.
|        |  +> Configurations EE9 Demo JSP WebApp@2ba5aa7a size=15

If we do the same thing, but with ee10 ...

$ mkdir demos-12-ee10
$ cd demos-12-ee10
$ java -jar ../../jetty-home-12.0.7/start.jar --add-module=http,ee10-deploy,ee10-demos
$ java -jar ../../jetty-home-12.0.7/start.jar --list-config | grep addServer
 jetty.webapp.addServerClasses = org.eclipse.jetty.logging.,${jetty.home.uri}/lib/logging/,org.slf4j.,${jetty.base.uri}/lib/bouncycastle/

And run with server dump ...

$ java -jar ../../jetty-home-12.0.7/start.jar jetty.server.dumpAfterStart=true
|        +> Serverclasses EE10 Demo Spec WebApp@32057e6 size=27
|        |  +> -org.eclipse.jetty.ee10.apache.
|        |  +> -org.eclipse.jetty.ee10.jaas.
|        |  +> -org.eclipse.jetty.ee10.jsp.
|        |  +> -org.eclipse.jetty.ee10.servlet.DefaultServlet
|        |  +> -org.eclipse.jetty.ee10.servlet.NoJspServlet
|        |  +> -org.eclipse.jetty.ee10.servlet.StatisticsServlet
|        |  +> -org.eclipse.jetty.ee10.servlet.listener.
|        |  +> -org.eclipse.jetty.ee10.servlets.
|        |  +> -org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainerProvider
|        |  +> -org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketShutdownContainer
|        |  +> -org.eclipse.jetty.ee10.websocket.jakarta.server.config.
|        |  +> -org.eclipse.jetty.ee10.websocket.server.
|        |  +> -org.eclipse.jetty.ee10.websocket.servlet.
|        |  +> -org.eclipse.jetty.jndi.
|        |  +> -org.eclipse.jetty.security.jaas.
|        |  +> -org.eclipse.jetty.websocket.api.
|        |  +> -org.eclipse.jetty.websocket.server.
|        |  +> file:///home/joakim/code/jetty/distros/bases/demos-12-ee10/lib/bouncycastle/
|        |  +> file:///home/joakim/code/jetty/distros/jetty-home-12.0.7/lib/logging/
|        |  +> org.eclipse.jdt.
|        |  +> org.eclipse.jetty.
|        |  +> org.eclipse.jetty.ee10.websocket.server.config.
|        |  +> org.eclipse.jetty.ee10.websocket.server.internal.
|        |  +> org.eclipse.jetty.logging.
|        |  +> org.eclipse.jetty.websocket.server.internal.
|        |  +> org.objectweb.asm.
|        |  +> org.slf4j.
|        +> Configurations EE10 Demo Spec WebApp@32057e6 size=15

You can see that the ee10 environment is working as expected with the jetty.webapp.addServerClasses

@joakime joakime added the Bug For general bugs on Jetty side label Mar 13, 2024
@joakime joakime changed the title Start properties jetty.webapp.addServerClasses and jetty.webapp.addSystemClasses are not propagated to ee8/ee9 deployments Start properties jetty.webapp.addServerClasses and jetty.webapp.addSystemClasses are not applied during ee8/ee9 deployments Mar 13, 2024
joakime added a commit that referenced this issue Mar 13, 2024
@joakime joakime self-assigned this Mar 13, 2024
@joakime joakime moved this to 🏗 In progress in Jetty 12.0.8 - FROZEN Mar 13, 2024
@joakime joakime moved this to 🏗 In progress in Jetty 12.0.9 - FROZEN Mar 27, 2024
gregw added a commit that referenced this issue Apr 12, 2024
…es in all environments (#11566)

* Issue #11514 - Cleanup `jetty.webapp.addServerClasses` property behavior for ee10/ee9/ee8

* Fix test

* Merging patterns (default -> env -> config)

* Moved ClassMatcher to util

* Adding more deprecations

* Changing XML demos/tests to use new getter names

* rollback xml changes in ee9/ee8

---------

Co-authored-by: Joakim Erdfelt <[email protected]>
Co-authored-by: Jan Bartel <[email protected]>
@joakime
Copy link
Contributor Author

joakime commented Apr 17, 2024

Completed in PR #11566

@joakime joakime closed this as completed Apr 17, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Jetty 12.0.9 - FROZEN Apr 17, 2024
joakime added a commit that referenced this issue Apr 26, 2024
* Issue #11514 - Cleanup `jetty.webapp.addServerClasses` property behavior for ee10/ee9/ee8

* Merging patterns (default -> env -> config)
* Moved ClassMatcher to util
* System Server Classes
* Renaming to Hidden/Protected
* Updated for loss of dump.war
* Update jetty-core/jetty-ee/src/main/java/org/eclipse/jetty/ee/WebappClassLoading.java
* fixed OSGi tests
* Ensure default hidden server and system classes.
* Fixed ee9 OSGi to load jetty-ee
* Adding more deprecations
* Changing XML demos/tests to use new getter names
* rollback xml changes in ee9/ee8
* Fix ee8 maven plugin
* Make jetty-maven dependency optional in ee9 to match ee10

---------

Co-authored-by: Joakim Erdfelt <[email protected]>
Co-authored-by: gregw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
1 participant