This is an automated email from the ASF dual-hosted git repository. rzo1 pushed a commit to branch tomee-10.x in repository https://gitbox.apache.org/repos/asf/tomee.git
commit 078a4d2f120c83e7b358ce22376b7ac894a33bbb Author: Markus Jung <[email protected]> AuthorDate: Wed May 27 08:09:44 2026 +0200 Unwrap InternalApplication before passing to CXF (cherry picked from commit 76345242343cc2dbefc3c84599fc42c06f376595) --- .../org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java index b0e82b19da..861f5b0f83 100644 --- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java +++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java @@ -733,8 +733,16 @@ public class CxfRsHttpListener implements RsHttpListener { * * Global binding annotations are tested in: * com/sun/ts/tests/jaxrs/spec/filter/globalbinding/JAXRSClient#globalBoundResourceTest_from_standalone + * + * We unwrap any InternalApplication wrapper so CXF inspects the user's real + * Application subclass. Without this, the @ApplicationPath annotation on the + * user's class is invisible to CXF, and UriInfoImpl#getMatchedResourceTemplate + * omits the application path prefix from the returned template. */ - factory.setApplication(application); + final Application appForFactory = application instanceof InternalApplication wrapper && wrapper.getOriginal() != null + ? wrapper.getOriginal() + : application; + factory.setApplication(appForFactory); this.context = webContext; if (!webContext.startsWith("/")) {
