Moqui 4.0 - Java EE to Jakarta EE

Since Oracle gave java ee to the eclipse foundation, they renamed java ee to jakarta ee and have a whole new package structure.

First we need to check to see which dependencies we depend use java ee, and which will support jakarta ee. If there are libraries that we depend on that don’t support jakarta ee, then we might be able to use eclipse’s transformer or openrewrite (see links below) at compile time to handle libraries that don’t support it.

If our dependencies support jakarta ee, then we’ll need to migrate our javax.* and any other java ee dependencies in our source to jakarta.* (see the java and groovy code). There are some potentially useful tools that would help in this process like:

Note that bitronix uses javax Code search results · GitHub. Looks like another project had the same issue: Transition from Jakarta EE 8 to Jakarta EE 9 · Issue #26041 · apache/shardingsphere · GitHub. There was a fork of bitronix that got jakarta ee working: GitHub - laingke/btm: JTA Transaction Manager. This will need to be looked at further.

If @f.karim @kieuanhvu @rahulnama @shahbaz @zhangwei can volunteer for figuring out what dependencies will / won’t support jakarta ee out of the box, that would be great!

I’ve run into this trying to implement the Java SDK reference MCP servlet in Moqui. It wants Jakarta Servlets. I didn’t realize how central SSE is to most MCP implementations and looking at the reference implementation made me not want to implement it myself.

There are massive changes to JTA, so we either move away from bitronix to a modern jakarta transaction manager like Narayana or we simply keep using JTA 1.1.

In my opinion, not worth the switch, we depend directly on this API and possibly many components and implementations are done on top of it. I could be wrong but worth asking the community at least before switching.

hmm, actually I might be wrong about this after some more research. It seems most of the changes are just namespaces, the APIs if we don’t use new stuff remains intact. I’ll dig some more and see.

OK I was able to easily upgrade bitronix to Jakarta JTA 2.0.1! All tests pass.

3 Likes