https://bz.apache.org/bugzilla/show_bug.cgi?id=70187

            Bug ID: 70187
           Summary: Tomcat embeded server shades packages that are
                    declared by servlet API modules
           Product: Tomcat 11
           Version: 11.0.24
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Packaging
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: -------

tomcat-embed-core exports the Jakarta Servlet API packages from its own module,
making it unusable alongside jakarta.servlet:jakarta.servlet-api on the module
path. The module declares:


open module [email protected] {
  exports jakarta.servlet;
  exports jakarta.servlet.annotation;
  exports jakarta.servlet.descriptor;
  exports jakarta.servlet.http;
  ...
}

Those are exactly the four packages that jakarta.servlet:jakarta.servlet-api
exports from module jakarta.servlet. Any application that puts both on the
module path fails to compile. This is especially painful since Spring uses
Tomcat embeded:

error: module spring.web reads package jakarta.servlet
       from both org.apache.tomcat.embed.core and jakarta.servlet
error: module spring.web reads package jakarta.servlet.annotation
       from both org.apache.tomcat.embed.core and jakarta.servlet
error: module spring.web reads package jakarta.servlet.descriptor
       from both org.apache.tomcat.embed.core and jakarta.servlet
error: module spring.web reads package jakarta.servlet.http
       from both org.apache.tomcat.embed.core and jakarta.servlet

Could you clean up this module hierarchy? The module already requires external
dependencies and it should not break running modular applications altogether.

This seems to also be a problem for:

  exports jakarta.security.auth.message;
  exports jakarta.security.auth.message.callback;
  exports jakarta.security.auth.message.config;
  exports jakarta.security.auth.message.module;

At the same time, other annotations are required as module dependency:

requires transitive jakarta.annotation;

Therefore, I do not understand this as an attempt to shade fully.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to