Skip to content

Upgrade Jetty 11.0.25 to 12.0.16 (EE10)#6144

Open
joewiz wants to merge 6 commits intoeXist-db:developfrom
joewiz:feature/jetty-12-upgrade
Open

Upgrade Jetty 11.0.25 to 12.0.16 (EE10)#6144
joewiz wants to merge 6 commits intoeXist-db:developfrom
joewiz:feature/jetty-12-upgrade

Conversation

@joewiz
Copy link
Member

@joewiz joewiz commented Mar 16, 2026

Summary

Upgrades Jetty from 11.0.25 (EOL since Jan 2025) to 12.0.16 with EE10 (Jakarta EE 10, Servlet 6.0).

Commits

# Commit Scope
1 Dependencies Jetty 12, Servlet 6.0, ee10 artifacts, Milton servlet fix
2 XML config Handler model, deployer, security, compliance, class paths
3 Java code JettyStart, WebAppContext, Servlet 6.0 API changes
4 Test updates web.xml schemas, XSD files, @ignore HTTP/0.9+1.0, test API

Key Changes

Jetty 12

  • Servlet artifacts → org.eclipse.jetty.ee10 namespace; JAAS → jetty-security
  • HandlerCollectionHandler$Sequence; PathResourceResourceFactory
  • Inline addHandler deployment replaces ContextProvider scanner
  • UriComplianceUNSAFE for non-ASCII path support
  • webdefault.xml: DefaultServlet/IntrospectorCleaner → ee10 packages

Servlet 6.0

  • Added: getServletConnection(), getRequestId(), getProtocolRequestId()
  • Removed: setStatus(int, String), isRequestedSessionIdFromUrl(), getRealPath(String)
  • All web.xml descriptors → version="6.0"; distribution XSDs → Jakarta EE 10

Milton servlet compatibility

Milton 1.8.1.3-jakarta5 calls HttpServletResponse.setStatus(int, String) which was removed in Servlet 6.0. This PR temporarily uses the com.evolvedbinary.thirdparty.com.ettrema:milton-servlet:1.8.1.3-jakarta-ee10 variant which fixes this one-line call. TODO: Republish this fix under the org.exist-db.thirdparty groupId to eliminate the Evolved Binary dependency.

Test Results

Module Tests Result
exist-core ~6490 All pass (4 HTTP/0.9+1.0 @ignored)
RestXQ 20 All pass
File Module 63 All pass
Persistent Login All pass
WebDAV 13 All pass

🤖 Generated with Claude Code

@joewiz joewiz requested a review from a team as a code owner March 16, 2026 05:47
@joewiz joewiz force-pushed the feature/jetty-12-upgrade branch 4 times, most recently from 76be363 to 54b6660 Compare March 17, 2026 03:08
joewiz and others added 4 commits March 16, 2026 23:32
Dependency version changes:
- Jetty: 11.0.25 -> 12.0.16
- Jakarta Servlet API: 5.0.0 -> 6.0.0 (EE10)
- Milton servlet: 1.8.1.3-jakarta5 -> 1.8.1.3-jakarta-ee10
  (fixes setStatus(int,String) removal in Servlet 6.0;
  temporarily uses com.evolvedbinary.thirdparty groupId —
  needs republishing under org.exist-db.thirdparty)

Jetty 12 artifact coordinate changes:
- Servlet-layer: org.eclipse.jetty -> org.eclipse.jetty.ee10
  (annotations, servlet, webapp, plus, jndi)
- WebSocket: org.eclipse.jetty.websocket -> org.eclipse.jetty.ee10.websocket
- JAAS: removed as separate dep (now in jetty-security core module)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Handler model:
- HandlerCollection -> Handler$Sequence (constructor takes Array arg)
- Server constructor arg: threadpool -> threadPool (case-sensitive)

Deployment:
- Replaced ContextProvider/scanner with inline addHandler on
  ContextHandlerCollection

Security and class paths:
- ConstraintSecurityHandler -> org.eclipse.jetty.ee10.servlet.security
- JAASLoginService -> org.eclipse.jetty.security.jaas
- DefaultServlet/IntrospectorCleaner -> ee10 packages
- ELContextCleaner removed (obsolete)

Compliance and other:
- MultiPartFormDataCompliance -> MultiPartCompliance
- UriCompliance: LEGACY -> UNSAFE (non-ASCII path support)
- SecureRequestCustomizer: constructor args -> setter-based
- GzipHandler: use addIncludedMethods
- Removed org.eclipse.jetty.util.log.Log references

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
JettyStart.java: Handler model rewrite, ResourceFactory, ee10 packages
WebAppContext.java: extends ee10 WebAppContext
HttpServletRequestWrapper.java: Servlet 6.0 additions/removals
XQueryURLRewrite.java, HttpServletResponseAdapter.java: removed
  setStatus(int, String)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- All web-app version="5.0" -> "6.0" with Servlet 6.0 schema refs
- Distribution XSDs: real Jakarta EE 10 schemas from jakarta.ee
- @ignore GetDataTest HTTP/0.9 and HTTP/1.0 tests (Jetty 12)
- DbStore2Test: Jetty 12 ResourceHandler/Handler.Sequence API

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@joewiz joewiz force-pushed the feature/jetty-12-upgrade branch from 54b6660 to 00941f2 Compare March 17, 2026 03:36
@joewiz joewiz changed the title Upgrade Jetty 11 to 12 (EE10) Upgrade Jetty 11.0.25 to 12.0.16 (EE10) Mar 17, 2026
New LockTest with 3 tests:
- lockAndUnlockXmlDocument: LOCK returns token, UNLOCK succeeds
- lockAndUnlockBinDocument: same for binary documents
- relockReturnsFreshToken: re-LOCK by same user replaces the lock

Ensures LOCK support (Milton 1.x LockableResource) is preserved
across the Jetty 12 upgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace toUpperCase().equals() with equalsIgnoreCase(), remove dead
instanceof check, collapse nested ifs, fix parameter reassignments,
remove unnecessary constructor, and suppress false-positive
UnusedPrivateMethod warnings (PMD doesn't detect switch expression calls).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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