fix: Derive the context path from the deployment archive name; resolve #285 - #287
Open
rhusar wants to merge 2 commits into
Open
fix: Derive the context path from the deployment archive name; resolve #285#287rhusar wants to merge 2 commits into
rhusar wants to merge 2 commits into
Conversation
…arquillian#285 Tomcat infers a web application's context path from its deployment name and never from the path attribute of a WAR bundled META-INF/context.xml, which it explicitly ignores. A "#" in the name denotes a path separator and a "##" the start of a parallel deployment version. The embedded container already delegated this to Catalina's ContextName, but the managed and remote containers only stripped the file extension. Deploying foo#bar.war through the manager therefore sent path=/foo#bar, which Tomcat rejects outright: FAIL - Failed to deploy application at context path [/foo#bar] Add an equivalent ContextName for the modules that cannot depend on Catalina and use it to send the decoded path, along with a version parameter for a parallel deployment, to the manager. ProtocolMetadataParser now distinguishes the two identifiers it had conflated: the JMX WebModule key needs the context name, whereas a servlet's context root needs the context path, since a versioned deployment is served from its path and not its versioned name. Note that only the ".war" extension is stripped now, matching both Tomcat and the embedded container, where the previous behaviour truncated at the last dot. Also resolve the test servlet URL relative to the context root. A leading "/" resolved against the host instead, so every non-root test was in fact invoking the ROOT deployment's servlet. Signed-off-by: Radoslav Husar <rhusar@ibm.com>
Signed-off-by: Radoslav Husar <rhusar@ibm.com>
rhusar
marked this pull request as ready for review
August 10, 2026 21:35
Member
Author
|
@smagellan any chance you had time to test this change whether this resolves your issue? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tomcat infers a web application's context path from its deployment name and
never from the path attribute of a WAR bundled META-INF/context.xml, which it
explicitly ignores. A "#" in the name denotes a path separator and a "##" the
start of a parallel deployment version.
The embedded container already delegated this to Catalina's ContextName, but
the managed and remote containers only stripped the file extension. Deploying
foo#bar.war through the manager therefore sent path=/foo#bar, which Tomcat
rejects outright:
FAIL - Failed to deploy application at context path [/foo#bar]
Add an equivalent ContextName for the modules that cannot depend on Catalina
and use it to send the decoded path, along with a version parameter for a
parallel deployment, to the manager. ProtocolMetadataParser now distinguishes
the two identifiers it had conflated: the JMX WebModule key needs the context
name, whereas a servlet's context root needs the context path, since a
versioned deployment is served from its path and not its versioned name.
Note that only the ".war" extension is stripped now, matching both Tomcat and
the embedded container, where the previous behaviour truncated at the last dot.
Also resolve the test servlet URL relative to the context root. A leading "/"
resolved against the host instead, so every non-root test was in fact invoking
the ROOT deployment's servlet.