News

Weld 4.0.2.Final and 3.1.8.Final

2021-7-14   release   Matej Novotny

New maintenance releases for Weld 3 and 4 have been rolled out.

There is only a handful of changes this time so let’s skid across them:

  • Prevent WeldInvocationContext from ever returning null when queried for interceptor bindings (WELD-2675)

  • Fix an NPE if there is an EJB bean with default package present (WELD-2674)

  • Weld wasn’t working on JDK 17 due to jboss-classfilewriter issue; this should no longer be the case (WELD-2671)

  • Correction to proxy name creation for producers based on interfaces - Weld should now use package and class of the most specific interface (WELD-2675)

  • Weld now provides correct metadata (via @Decorated) in cases where more than one decorator is applied to a single bean (WELD-2673)

  • We have decided to no longer provide WildFly patches for each release (WELD-2660)

    • After discussion with WildFly team, we figured the current way is not going to work for anything beyond Weld 3

    • And we aren’t even certain this feature is requested and/or used anymore; if you feel otherwise, please create a JIRA to let us know


Weld 4.0.1.SP1 and 3.1.7.SP1

2021-4-14   release   Matej Novotny

Thanks to your reports, several flaws were discovered in the new class defining for JDK 11+. We have addressed those issues and because we reckon they are potentially blocking, we have released Weld 3.1.7.SP1 and 4.0.1.SP1.

Two main issues were:

  • Producers returning an interface type could sometimes try to define a proxy class with invalid name (WELD-2662)

    • Similar thing could happen for inner classes which should now work as well

  • Proxy class names for hierarchical type structures of interfaces could lead to a jumbled combination of package and name (WELD-2666)

    • Part of this fix is also an improvement wherein Weld actively tries to define new proxies into non-java packages making sure it uses MethodHandles.Lookup whenever applicable

Apart from that, this release also addresses a problem with Undertow servlet integration in which (Weld tried too eagerly to provide it’s own instances of Listener).


Weld 4.0.1.Final

2021-3-22   release   Matej Novotny

First maintainance release of Weld 4 is now available along with API version 4.0.SP1.

The crux of this release is (much like 3.1.7.Final) a rework of Weld’s default class defining capabilities. With 4.0.1.Final you should no longer see illegal reflective access warning so long as you are on JDK 11 or newer. More details on this are below or in the respective JIRA ticket; in case you encounter any issue with it, please don’t hesitate to reach out to us.

So, let’s take a closer look:

  • Class Defining in Weld

    • Weld Core is now a Multi-Release JAR providing two different implementations for JDK 8 and JDK 11 or newer

    • Integrators are still encouraged to implement ProxyServices class from our API

    • For SE environment or an integrator that doesn’t implement the aforementioned API, Weld now provides a default implementation of ProxyServices which:

      • On JDK 8 behaves the same as it did until now - it cracks open ClassLoader.defineClass(…​) method and uses that

      • On JDK 11+ it uses a combination of MethodHandles.Lookup and a custom ClassLoader; the former is used for vast majority of cases with class loader being a solution for edge cases such as default packages or beans from signed JARs

  • Other Weld Core Fixes

    • BeanAttributesConfigurator could incorrectly initialize default qualifiers when @Named was involved (WELD-2659)

    • Synthetic alternative beans did not trigger ProcessBean event as they should when enabled (WELD-2658)

    • Fixed proxy creation for beans in default package (WELD-2657)

    • Fixed a corner case scenario where a hierarchy of classes with bridge methods would not get correctly intercepted (WELD-2656)

    • ProxyFactory now creates determininistic proxy names (WELD-2618)

    • Decorators for interfaces with non-decorated default method now work properly (WELD-2647)

WildFly Patch

There is no WildFly patch at the moment. We are currently exploring how to properly ship a patch that would align with WildFly usage of Galleon; the tracking JIRA can be seen (here).


Weld 3.1.7.Final

2021-3-18   release   Matej Novotny

Weld 3.1.7.Final along with API 3.1.SP4 is now up for grabs!

Along a few bugfixes, the flagship of this release is a rework of Weld’s default class defining utilities which should eliminate those pesky JDK 11+ warnings about illegal reflective access. You can find more details on it below or in the JIRA ticket; in case you encounter any issue with it, please don’t hesitate to reach out to us.

So, let’s take a closer look:

  • Class Defining in Weld

    • Weld Core is now a Multi-Release JAR providing two different implementations for JDK 8 and JDK 11 or newer

    • Integrators are still encouraged to implement ProxyServices class from our API

    • For SE environment or an integrator that doesn’t implement the aforementioned API, Weld now provides a default implementation of ProxyServices which:

      • On JDK 8 behaves the same as it did until now - it cracks open ClassLoader.defineClass(…​) method and uses that

      • On JDK 11+ it uses a combination of MethodHandles.Lookup and a custom ClassLoader; the former is used for vast majority of cases with class loader being a solution for edge cases such as default packages or beans from signed JARs

  • Other Weld Core Fixes

    • BeanAttributesConfigurator could incorrectly initialize default qualifiers when @Named was involved (WELD-2659)

    • Synthetic alternative beans did not trigger ProcessBean event as they should when enabled (WELD-2658)

    • Fixed proxy creation for beans in default package (WELD-2657)

    • Fixed a corner case scenario where a hierarchy of classes with bridge methods would not get correctly intercepted (WELD-2656)

WildFly Patch

There is no WildFly patch at the moment. We are currently exploring how to properly ship a patch that would align with WildFly usage of Galleon; the tracking JIRA can be seen (here).


Weld 3.1.6.Final

2021-1-13   release   Matej Novotny

Weld 3.1.6.Final is now available and brings a dosage of bug fixes and updates with it. Without further due, let’s dive straight into it!

Fixes and improvements:

  • Weld Core

    • Fix for decorators operating on interfaces with default methods (WELD-2647)

    • Weld will no longer try to load classes for specific JDK version when using multi-release JARs (WELD-2652)

    • ProxyFactory was changed to produce more deterministic and sensible names when based off interfaces (WELD-2618)

      • NOTE: this slightly changes names of generated proxy classes but has no effect on the functionality itself

  • Weld Servlet

    • Detect Jetty server in GWT 2.8+ test environment (WELD-2635)

    • Injection into Undertow servlet listener now works as intended (WELD-2636)

      • This should work from Undertow 2.2.0.Final onwards

  • Weld SE

    • Bean defining annotation can be specified as generic SeContainerInitializer property (WELD-2639)

  • Other bits

    • Fixed issue preventing upgrade of surefire plugin in our testsuite (WELD-2634)

    • Several corrections to OSGi package configuration (WELD-2642, WELD-2644, WELD-2645, WELD-2646)

    • Re-introduce multi HTML documentation output in best-effort mode; this is mainly to keep old links working (WELD-2640)

    • Fix intermittent test failure in DispatchingTest caused by race condition (WELD-2650)

WildFly Patch

This time around, the patch for WildFly 21.0.2.Final is available.

If you’re not familiar with patching WildFly, check the FAQ.