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

Review deployment of Jetty Context XML files #10411

Closed
sbordet opened this issue Aug 26, 2023 · 3 comments · Fixed by #10415
Closed

Review deployment of Jetty Context XML files #10411

sbordet opened this issue Aug 26, 2023 · 3 comments · Fixed by #10415
Labels
Bug For general bugs on Jetty side

Comments

@sbordet
Copy link
Contributor

sbordet commented Aug 26, 2023

Jetty version(s)
12

Description
Follow-up issue to #10158, where the deployment of Jetty Context XML files should be able to pick a default environment.
See the comments in #10158, as this should not be resolved by documentation only -- it should work out of the box.

@sbordet sbordet added the Bug For general bugs on Jetty side label Aug 26, 2023
sbordet added a commit that referenced this issue Aug 26, 2023
Updated the documentation; a better fix is coming with #10411.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@gregw
Copy link
Contributor

gregw commented Aug 27, 2023

Note that currently it does "work out of the box" for many (most?) deployments that will only have single environment enabled, as that will be the environment used for xml deployments.

If we have multiple deployments than currently we use the "heuristic" of:

  1. If there is an env defined in a property file, then use that.
  2. else default to the most "senior" environment: core < ee8 < ee9 < ee10

To do something smarter we'd need to do:

  1. If there is an env defined in a property file, then use that.
  2. inspect the deploy target for a hint of which environment to use
  3. else default to the most "senior" environment: core < ee8 < ee9 < ee10

To get the hint we might need:

  • to crack open a WEB-INF/web.xml to look for which version of EE it is using as it's schema/dtd. But this only gives the minimal environment and plenty of webapps are deployed in ee9 with earlier ee descriptors
  • parse a context.xml looking for the class of the context. This will work if they directly use an eeN ContextHandler, but will be difficult if they use their own extended handler. We may end up having to try environments to see which we can load in?

I'm not sure either of these is robust enough to be worthwhile.

@gregw
Copy link
Contributor

gregw commented Aug 27, 2023

Oh I just tested my assumption above that a context.xml would be deployed if we only had a single environment enabled. Apparently not! So I think if we fix that, then this will be a lot better. Looking....

gregw added a commit that referenced this issue Aug 27, 2023
Implemented a simpler default environment algorithm where an application that does not specify an environment is always attempted in the default.
@gregw gregw linked a pull request Aug 27, 2023 that will close this issue
gregw added a commit that referenced this issue Aug 29, 2023
sbordet added a commit that referenced this issue Aug 29, 2023
Implemented a simpler default environment algorithm where an application that does not specify an environment is always attempted in the default.

Updated documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor Author

sbordet commented Aug 29, 2023

Fixed by #10415.

@sbordet sbordet closed this as completed Aug 29, 2023
lorban pushed a commit that referenced this issue Aug 30, 2023
Implemented a simpler default environment algorithm where an application that does not specify an environment is always attempted in the default.

Updated documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants