BlogTomcat

What actually breaks in a javax to jakarta migration?

Scott Sternloff

By Scott Sternloff, Senior Enterprise Architect

LinkedIn · Updated · 5 min read

What actually breaks in a javax to jakarta migration?
On this page

Short answer

Most of what breaks is not your code. Migrating from Java EE to Jakarta EE by moving Tomcat 9 to 10.1 or 11 renames the Servlet, JSP, EL and WebSocket packages from javax to jakarta, so every library, agent and config file that touches those packages has to change too. AceMQ engineers who have done this migration check the dependencies first and the application source last.

Most of what breaks is not your code. Migrating from Java EE to Jakarta EE by moving Tomcat 9 to 10.1 or 11 renames the Servlet, JSP, EL and WebSocket packages from javax to jakarta, so every library, agent and config file that touches those packages has to change too. AceMQ engineers who have done this migration check the dependencies first and the application source last.

Apache's Tomcat 10.0.x migration guide states the change plainly: the specification packages moved, and "it will be necessary to recompile web applications against the new APIs." The rest of this post is the order we would work in if you asked our tomcat consulting team to plan it. It uses only what Apache documents, and no client numbers.

Which Tomcat version needs which Java and namespace?

Apache's Which Version page sets the lines apart. Pick the target before you scan anything, because it decides your Java upgrade too.

Tomcat lines, read on tomcat.apache.org on 4 December 2026
TomcatPlatformServletNamespaceMinimum Java
9.0.xJava EE 84.0javax.*8
10.1.xJakarta EE 106.0jakarta.*11
11.0.xJakarta EE 116.1jakarta.*17

Tomcat 10.0 is a stepping stone: Jakarta EE 9 and the new namespace, still on Java 8. If Tomcat is embedded in a framework such as Spring Boot, the framework release decides which Tomcat you get, so read its release notes first. 10.1 raises the floor to Java 11, so a team still on Java 8 has two upgrades in one project. Our Tomcat end-of-life guide covers the support dates that decide which line to aim for.

Where do javax references hide?

Code changes are rarely the problem: javax references hide in five places, and only the first is yours. Unpack the WAR and every JAR in WEB-INF/lib into a scratch folder and search that, not just your source tree.

Where javax references turn up and what to do
PlaceHow to find itUsual fix
Your own source and JSPsgrep -rlE 'javax\.(servlet|websocket|el)' srcRename, or convert the built artifact with Apache's tool
Third-party JARs in WEB-INF/libSearch class files for javax/servlet and text files for javax.servletUpgrade to the vendor's Jakarta build; convert only if none exists
Java agents and valves on the serverCheck JAVA_OPTS for -javaagent and server.xml for custom valvesAsk the vendor for a Jakarta-compatible release
XML and properties filesSearch web.xml, context.xml and framework config for class namesThe tool rewrites config files and String constants
Reflection and class-name stringsSearch for javax. inside quoted stringsTool handles String constants; test code paths that build names at runtime

Not every javax package moves. The tool's README says only packages defined as part of Java EE are renamed, so JDK packages such as javax.sql are untouched, and XML schemas do not need changes because Jakarta EE 9 still supports the Java EE 8 schemas.

How does Apache's migration tool help?

Apache ships a Tomcat Migration Tool for Jakarta EE that converts an application so it runs on Tomcat 10 or newer. Run it from the command line against a WAR, folder or single file:

java -jar jakartaee-migration-*-shaded.jar <source> <destination>

There are two ways to use it. Tomcat can convert a webapp at deployment if you drop it in the host's legacyAppBase folder, webapps-javaee by default, and it lands converted in webapps. Apache says converting ahead of time gives faster deployment and more precise options, which we would pick for production.

Two cautions from the README: the tool removes signatures from signed JARs, logging a warning for each, and it can modify third-party content, so check that each licence allows it before you distribute the result.

What else changes in Tomcat itself?

The namespace is not the only difference, and the Tomcat 10.0 migration guide lists the rest. These are the ones we would test before cutover:

  • Sessions: persistence on restart is disabled by default. If users should survive a restart, re-enable it in conf/context.xml.
  • Access log: the %D pattern now logs microseconds, not milliseconds. Use %{ms}T to keep milliseconds, or your dashboards read a thousand times higher.
  • Encoding: conf/web.xml sets the default request and response encoding to UTF-8.
  • Uploads: from 10.0.11, multipart uploads use java.nio.file.Files, so the JVM needs direct memory for in-progress uploads. Our Tomcat production guide covers sizing.

In what order should you rehearse it?

  1. Choose the target line (10.1 or 11, not the 10.0 stepping stone) and Java version from the table above.
  2. Inventory every JAR, agent and valve, with the vendor's Jakarta statement beside each.
  3. Upgrade libraries first on Tomcat 9 where the vendor ships a version that supports both, so the library change is not mixed with the server change.
  4. Convert a copy with the migration tool and deploy it on a restored copy of production config.
  5. Run the checks above (sessions, %D, encoding, uploads) and compare thread dumps under load against the old server.
  6. Write the rollback before the cutover: the old WAR, the old conf/ and the Java version it ran on.

Where the scan shows few javax references, your team can do this from Apache's guide. Where agents, old frameworks or signed vendor JARs appear, ask for a rehearsal and a written rollback before a date is set. See Tomcat support for what that looks like, or the connector and thread-pool review for the tuning pass after the move.

Sources

Frequently Asked Questions

Does the Apache migration tool convert everything?

It renames Java EE 8 javax packages to their Jakarta EE 9 names in classes, String constants, configuration files, JSPs and TLDs. It does not choose newer library versions for you, and it removes signatures from JARs, so signed JARs no longer verify.

Can I jump straight from Tomcat 9 to 11?

Yes if the Java and library versions allow it. Tomcat 11.0 needs Java 17 and 10.1 needs Java 11, so many teams move the Java version first and the namespace second, so each change can be tested alone.

When does Tomcat 9 stop being supported?

Apache's Which Version page says Tomcat 9 is the last major version to implement Java EE and expects its end of support no earlier than 31 March 2027.

Scott Sternloff

Author

Scott SternloffSenior Enterprise Architect

Senior Enterprise Architect at AceMQ. Writes the technical coverage here: RabbitMQ, Kafka and Redis architecture, clustering and migrations.

Talk to an engineer

Need a hand with Tomcat?

Senior engineers who run it in production. Get a quote or a free consultation, no sales pitch.

Free Consultation

Get Expert Eyes on Your Tomcat Environment

Whether you're troubleshooting a production incident, planning a migration, or want a second opinion on your architecture — our team is ready. No pitch, just answers.

Email Us