Skip to main content

Today the new jakarta namespace enters our lives at mass scale with the release of Jakarta EE 9 Milestone 1.

This Milestone release not only includes over 30 specifications, APIs and TCKs migrated from javax to jakarta, but also several implementations including Apache Tomcat 10.0.0-M6, Jetty 11.0.0-alpha0, OpenLiberty 20.0.0.7-beta and many more all supporting the `jakarta` namespace.

As a proud member of the Apache TomEE community we’re of course very excited to also announce the release of Apache TomEE 9.0.0 M1 supporting the new jakarta namespace.

Faster Through Tooling (technical)

A major challenge of this namespace change is impact in maintenance. Once you change your code over from javax-to-jakarta you can no longer use simple git merges to move fixes between branches. Any attempt to backport a patch would most likely result in a merge conflict where javax-to-jakarta namespace migrations have occurred.

In the Apache TomEE community several of us have been solving this problem at the bytecode level using two tools primarily: the Eclipse Transformer, the TomEE Patch Plugin.

The Eclipse Transformer is a bytecode transformation tool originally prototyped by BJ Hargrave using BND to specialize in the javax-to-jakarta namespace change. Intended as a way to migrate applications, we’ve been stretching the limits putting it to use to transform the entire Apache TomEE server distribution from javax-to-jakarta. We’re proud to now be one of the contributors to the project with special thanks to our own Jonathan Gallimore for his contribution of a Maven Plugin and several fixes. We’re excited about the strength this codebase is showing in solving this very difficult problem.

The TomEE Patch Plugin is a supplemental bytecode transformation tool we’ve been working on in the TomEE community based on ASM to handle edge cases where find/replace is not possible and arbitrary edits are needed. It’s currently applying about 16 very targeted patches to third-party libraries to account for specific needs in the namespace transition.

Throughout the process we’ve been using tools in ASM to express bytecode as text (ASMifier) so we can audit all 147,182 files across the four TomEE zip files as text. We checked all that text into git so on each change to the Eclipse Transformer or TomEE Patch Plugin that introduces new bytecode, we can spit it back to text, commit it to git and get a full diff in Github providing 100% visibility on any change to any class or file in any jar over all our distributions. In the end, it’s like working with source code.

After several weeks of work we were able to achieve what appears to be a 90% pass rate on the Jakarta EE 9 Milestone 1 Web Profile TCK.

Jakarta EE 8 and Jakarta EE 9 in parallel

While tales of bytecode are either very exciting or very boring for you, the most important win is that we will be able to work on and support Jakarta EE 8 compliance (javax.*) and Jakarta EE 9 compliance (jakarta.*) at the same time in the same codebase. No branches. No forks. No merge-conflict hell. Just two separate binaries from the same source; TomEE 8x for javax users: TomEE 9x for jakarta users.

Apache TomEE has been behind on achieving Jakarta EE 8 Web Profile TCK compliance and this technique not only allows us to keep this focus, but to pursue eventual Jakarta EE 9 compliance essentially for free. We are very hopeful to see a Jakarta EE 8 and Jakarta EE 9 certified distribution a few months after the Jakarta EE 9 final release in fall 2020.

Paving the Way

The effort we’re going through pales in comparison to the millions of affected jars and apps using the retired javax namespace built over the last 20 years. The world does not have the means to snap its fingers, increase the global workforce temporarily by 3x and do nothing but manually transform 20 years of code. The way we get through this is not by making more people, but by making more tools.

We are extremely thrilled to be on the front-line pushing the edges on tooling and techniques we will all need to unlock a successful future in the jakarta namespace. While this namespace change is an incredible challenge, it also is an incredible opportunity for innovation.

When you have a forcing function that requires change on 20 years worth of code we all use, there is no way for this tidal wave to come and go without leaving behind tremendous necessity-driven innovations in the industry. For now, we are barely even wet.

Enjoy the stone-in-the pond that is the Jakarta EE 9 Milestone release. Take hope in the good news of tools to help us all. Celebrate the exciting TomEE 9.0.0-M1 binaries as a sign of strength in our tooling story and how challenges can bring positive outcomes.

And above all, get ready because the best is yet to come.

David Blevins

David Blevins

David is a co-founder to OpenEJB (1999), Apache Geronimo (2003) and Apache TomEE (2011), 10-year member of the JCP serving in Java EE, EJB, CDI, JMS and Java EE Security JSRs, JavaOne RockStar for 2012 & 2013, 2015 inductee into the Java Champions and nominated for JCP Member of the Year 2015. He is a contributing author to Component-Based Software Engineering: “Putting the Pieces Together,” from Addison Wesley and a regular speaker at JavaOne, Devoxx, ApacheCon, OSCon, JAX and Java-focused conferences.
dblevins

Leave a Reply