Skip to content

Allow ContainerIncludeJarPattern to match jakarta.servlet-api in Jetty 12.1.15 - #563

Open
ludoch wants to merge 3 commits into
mainfrom
fix-devappserver-container-include-jar-pattern
Open

ludoch wants to merge 3 commits into
mainfrom
fix-devappserver-container-include-jar-pattern

Conversation

@ludoch

@ludoch ludoch commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #562 based on review feedback from @lachlan-roberts.

Context & Summary of Changes

  1. ContainerIncludeJarPattern Regex Matching:
    In Jetty 12.1.15, the servlet API jar was moved to ee11/support/jakarta.servlet.jakarta.servlet-api-6.1.0.jar. The previous pattern anchored on /jakarta.servlet-api- no longer matched because of the jakarta.servlet. prefix.
    Dropping the leading / allows .*jakarta.servlet-api-[^/]*\.jar$ to match both the legacy name (jakarta.servlet-api-6.1.0.jar) and the 12.1.15 name (jakarta.servlet.jakarta.servlet-api-6.1.0.jar).

  2. EE11 DevAppServerModulesFilter Import Fix:
    In runtime/local_jetty121_ee11/src/main/java/com/google/appengine/tools/development/jetty/ee11/JettyContainerService.java, updated the import of DevAppServerModulesFilter from the javax.servlet version (com.google.appengine.tools.development.DevAppServerModulesFilter) to the jakarta version (com.google.appengine.tools.development.jakarta.DevAppServerModulesFilter). This prevents a runtime NoClassDefFoundError: javax/servlet/Filter when running EE11 applications under DevAppServer.

  3. Module Exclusion Parity:
    In api_dev/src/main/java/com/google/appengine/tools/info/Jetty121EE8Sdk.java, added exclusion for -ethereum- jars to align with Jetty121EE11Sdk and getQuickStartClasspath().


New Regression Tests (JettySdkTest.java)

Added comprehensive regression tests in e2etests/devappservertests/src/test/java/com/google/appengine/tools/development/JettySdkTest.java:

  • testContainerIncludeJarPatternMatchesSharedJars:
    Verifies that the ContainerIncludeJarPattern configured on DevAppEngineWebAppContext successfully matches the shared container jars (jakarta.servlet-api and JSTL) in the SDK. This guarantees that TLDs and web fragments in shared libraries are scanned and accessible to webapps.

  • testNoJuliLoggingSpiInSharedOrJspLibs:
    Inspects all jars in lib/shared/ and jetty121/jetty-home/lib/ee*/ for both EE8 and EE11 to ensure no jar contains the Tomcat JULI Log ServiceLoader provider (META-INF/services/org.apache.juli.logging.Log), preventing classloader deadlocks and Commons-Logging hijacking.

  • testJspClasspathContainsRequiredClasses:
    Verifies that all classes required for JSP compilation and runtime execution are resolvable from the combined user JSP libs and shared libs classpath on both environments:

    • EE8: javax.servlet.jsp.JspPage, org.apache.jasper.servlet.JspServlet
    • EE11: jakarta.servlet.jsp.JspPage, jakarta.el.RecordELResolver, org.glassfish.wasp.runtime.TldScanner
  • testForbiddenModulesNotExposed:
    Verifies that optional, clustering, and non-supported Jetty modules (-cdi-, -alpn-, -demo-, -websocket-, -gcloud-, -infinispan-, -hazelcast-, -ethereum-) are completely excluded from shared and JSP classpaths across both EE8 and EE11.


Test & Coverage Status

  • devappservertests: 20/20 passed (100% pass rate)
    • JettySdkTest: 9/9 passed (all 4 new tests verified)
    • DevAppServerMainTest: 6/6 passed (verified EE8, EE10, EE11 under DevAppServer)
    • JaxRsTest: 5/5 passed
  • stagingtests: 293/293 passed (100% pass rate)
    • Verified staging, JSP precompilation, and quickstart-web.xml generation across EE8, EE10, and EE11 runtimes.
  • CI Matrix Status:
    • Ubuntu / Java 17: Build & test successful
    • Ubuntu / Java 21: Build & test successful
    • Ubuntu / Java 25: Build & test successful
    • Ubuntu / Java 28-ea: Build & test successful
    • CodeQL & CLA checks: Successful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant