News - tagged as "jakarta"

Weld 4 and Jakarta EE 9

2020-5-13   release , jakarta   Matej Novotny

Weld Meets Jakarta EE 9

Most of you surely know that Jakarta EE 9 is on the horizon; slowly but steadily it is making its way into Java world. And we are not far behind, in fact we have just released Weld 4.0.0.Alpha2 which is an implementation of CDI 3.0! You heard that right, in Jakarta EE 9, all APIs have bumped their major versions; CDI turned 3.0 and so Weld version implementing that became 4.0. Hand in hand with it goes Weld API 4.0.Alpha1, also adapted to EE 9.

Some basic information about the release:

  • All the bits should be available in Maven Central at this point.

  • There is also .zip distribution as usual, see download page for more information.

  • No WildFly patch is provided this time around because WildFly does not yet have an EE 9 branch.

Working and Broken Parts

The only, yet considerably huge, change in APIs is (or at least should be) the swap from javax to jakarta packages. This comes with bunch of problems, for instance there is no EE server that could run on EE 9 with new packages yet. GlassFish is going to be first and they are working on integrating all the EE 9 reference implementations. There are some chicken-egg problems such as Weld requiring EE 9 server to execute CDI TCKs, but at the same time there is GlassFish needing Weld 4.0 to start operating with EE 9 in the first place. For this reason, our first few 4.0 releases are going to be marked as Alpha or Beta, they will not be fully tested and might be missing some parts that previous releases contained.

Here’s what’s working:

  • All testing that doesn’t require full EE container

  • Weld core implementation and API works as usual and is fully released

  • Weld examples work only partially, all those needing EE container have nowhere to be deployed

  • Weld SE works fully

  • Weld Probe should work so long as you are in SE

And here are the missing parts:

  • We cannot execute CDI TCKs until there are stable GlassFish build

    • We should be able to renew this pretty soon

  • Other in-container tests that we have (running on WildFly) are now disabled

  • Servlet parts of Weld are completely excluded from early releases

    • This is because there is currently no servlet working on EE 9, therefore we have nothing to adapt our internals to, yet

One big and sadly unanswered question is that of backward compatibility. In Jakarta itself, there seems to be a consensus of EE 9 not being backward compatible with EE 8. Weld 4 on its own will not work with applications written for Java EE 8 - basically with anything requiring old javax namespace packages. However, EE servers will be forced to adapt somehow, so I expect a tooling might eventually emerge that will allow to run legacy applications on newer servers. But that is yet to be seen and surely no sooner than after EE 9 release when other big servers start to adopt it.

Development Plans

Just to make things clear - we are planning on actively developing both, Weld 3 and Weld 4. We understand that EE server will need to take their time switching to Jakarta EE 9, all the more due to the aforementioned circumstances around backward compatibility. Therefore, both our versions will get their share of updates and bug fixes in the future!