Jetty 11 Doesn’t Detect Servlets

Jetty 11 is based on Jakarta Servlet 5.0, which is part of Jakarta EE 9.

Jakarta EE 9 underwent the “big bang” change (their name, not mine) to namespace and packaging, there is no longer a javax.servlet.* it is now jakarta.servlet.*.

There is literally nothing in Jetty 11 that looks for javax.servlet.*.

Some quick history …

  • Oracle owned Java EE.
  • Oracle produced Java EE 7.
  • Oracle decided it didn’t want to create/manage EE anymore.
  • Oracle gave all of EE to the Eclipse Foundation.
  • Oracle did not grant the Eclipse Foundation the right to use “java” or “javax” in this new EE reality.
  • Eclipse Foundation renamed it to “Jakarta EE” for legal reasons.
  • Eclipse Foundation releases “Jakarta EE 8” which is essentially just “Java EE 7” renamed for legal reasons (no package namespace change yet)
  • Eclipse Foundation renamed all packaging from javax.<spec> to jakarta.<spec> for legal reasons.
  • Eclipse Foundation releases “Jakarta EE 9” which is essentially just “Jakarta EE 8” but with a namespace change (this is the “big bang” mentioned above)

(be aware, I skimmed over a lot of other things that happened between these steps)

javax.servlet.* is dead, long live jakarta.servlet.*.

Jetty maintains the following versions (currently)

Jetty Servlet EE Namespace
Jetty 10.x Servlet 4.0 Jakarta EE 8 javax.servlet
Jetty 11.x Servlet 5.0 Jakarta EE 9 jakarta.servlet

There is no backward compatibility feature to allow both javax.servlet and jakarta.servlet to coexist in a release of Jetty. (we’ve tried this a few times, the complexity of the Servlet spec makes this very difficult for the HttpSession, RequestDispatcher, Dynamic servlet/filter registrations, etc). Jetty is working with the Servlet spec in Servlet 6.0 to attempt to address these concerns. A single release of Jetty supporting both namespaces is not likely until Jetty 12.

For now, the best we can hope for (and there are several projects started to do this, all alpha quality ATM) is some kind of tooling that updates your jars and/or source for the new packaging in an automated fashion to then be run on a Jakarta based server.

Leave a Comment