News

Weld 3.0.5.Final

2018-7-26   release   Matej Novotny

Weld 3.0.5.Final is here and hand in hand with it comes Weld API 3.0.SP4. And in case you missed it, there was CDI 2.0.SP1 release as well. It comes with few security manager related fixes and Weld is of course compliant with it. If you are running on a servlet or in SE, you may need to update it yourself, in case of EE it usually falls to the server to update this dependency for you.

Note
This time around we are not providing a patch for WildFly 13 as there were major changes blocking us from doing so. However, Wildfly 14 will contain all of the above updates - Weld core, Weld API, CDI API - so keep an eye out for its release!

As for updates and fixes, we keep looking at JDK 11 and have done another round of fixing to keep up with adjustments and removals going on in JDK. There is a bunch of interceptor/decorator fixes for those of you who indulge in using complex class hierarchies with abstractions, generics and default methods. So let’s take a look at them all, shall we?

Fixes and improvements:

  • Weld Core

    • Fixed possible race condition appearing during bean index creation (WELD-2492)

    • Avoid creating unnecessary bean metatada for anonymous and local classes (WELD-2498)

    • Corrected decorator subclass creation when said decorator overrides only default method (WELD-2501)

    • Avoid optimizing self invocation of private methods in order to avoid IllegalAccessError (WELD-2506)

    • Allow interception of abstract, package-private classes with public methods (WELD-2507)

    • Fix interception of overriden generic methods invoked via superclass (WELD-2514)

    • Implement reflection fallback for qualifier loading when there are multiple instances of the class in the deployment (WELD-2250)

    • Make conversation ID parameter detection more robust (WELD-2512)

  • Weld SE

    • Make default StartMain more container friendly by exiting with error code should an exception appear (WELD-2502)

      • There is also a follow-up custom exception handling proposal if you want to glance at it (WELD-2503)

    • Fix possible NPE coming from beans.xml merging in complex Weld SE deployment scenarios (WELD-2515)

  • JDK 9/10 and onwards

    • WeldProvider moved to servlet core module to align it with how Jigsaw handles services (WELD-2435)

    • Fixed SE/Servlet resource loading behavior when ForkJoinPool is used on JDK 9+ (WELD-2494)

    • Review executability of Weld examples on JDK 10+ (WELD-2495)

    • Update to JBoss Classfilewriter 1.2.3.Final which is JDK 11 compliant (WELD-2509)

    • If running in JPMS, remove dependency on java.desktop to shrink the footprint (WELD-2504)

  • Probe development tool

    • Probe now recognizes BeforeDestroyed event (WELD-2500)

  • Other

    • We are now looking at testing Weld with JDK 11 on a regular basis and have taken steps to ensure it works (WELD-2516)

    • Updated patching profiles for Weld 3 and WFLY, the process is now more automated and configurable (WELD-2491)

    • OSGi bundle now import BCEL only optionally (WELD-2499)


Weld team changes

2018-7-10   team   Martin Kouba

I’m pleased to announce a couple of changes coming to the Weld team.

First of all, Matěj Novotný will be taking over the leadership of the project. Matěj has proven himself to be an excellent engineer, contributing not only to Weld projects but also to the CDI specification and TCK development. I’m really happy that I can hand over the leadership to this guy!

Matěj’s primary task is leading the project towards "Java 11 world" and to meet the other challenges such as reactive programming model enhancements.

Secondly, Nikoleta Žiaková is joining the team as a quality engineer. She’s going to work on expanding our testsuites and improving our continuous integration.

Last but not least, I’m not going to leave the project but stay as a contributor focused on related technologies such as WildFly, Thorntail and MicroProfile.

Martin


Weld 3.0.4.Final

2018-4-26   release   Matej Novotny

Weld 3.0.4.Final is here along with Weld API 3.0.SP3 - make sure you update both.

In this release we took first steps towards eliminating illegal access in JDK 10+. The good news is, Weld should now be able to run with --illegal-access=deny. The project and CI infrastructure around it went through a lot of changes to be able to build and execute on JDK 10 and there is still more to come. There are also numerous optimizations - beans.xml parsing, AT identifier representation, optional memory savings. And of course, bug fixes, so let us take a look at all of it.

Noticeable amount of reports, suggestions and even fixes came from the community - for that you have our thanks (and a new version of Weld of course)!

Fixes and improvements:

  • Weld Core

    • Correct proxy generation for class hierarchy with abstract class and generics (WELD-2470)

    • Opt-in enhancement in HTTP session replication, more eager approach (WELD-1130)

      • Note that WildFly does not need or use this

    • Fix NPE which could occur with SecurityManager if getPermissions() returned null (WELD-2464)

    • Relax bean type check in BeanManager.getInjectableReference() (WELD-2466)

    • AfterTypeDiscovery did not allow to remove declared interceptors/decorators/alternatives correctly (WELD-2479)

    • Two globally selected alternatives with the same priority should result in ambiguous dependency (WELD-2482)

    • Configurator SPI now uses sensible toString() so that user can tell what went wrong (WELD-2484)

    • Improve performance of beans.xml parsing (WELD-2469)

    • Introduce an optional configuration allowing Weld to perform cleanup after boot (WELD-2457 and WELD-2475)

      • In EE servers, if integrators meet certain conditions and allow for this, Weld can them drop metadata from some beans which will not be used in runtime

      • See Docs section for links

    • Optimise String representation of AnnotatedTypeIdentifier (WELD-2477)

  • Weld SE

    • Fix NPE which could occur if trying to intercept a method called by constructor (WELD-2478 and WELD-2473)

  • JDK 9/10 and onwards (WELD-2460)

    • Weld uses JDK’s internal BCEL classes (WELD-2490)

      • This is only used to report errors in generated bytecode on proxies/subclasses

      • We added a dependency on org.apache.bcel:bcel which enables this functionality without reflective access to internal libraries

      • In order to keep Weld’s footprint minimal, this dependency is optional only

    • Upgrade JBoss Classfilewriter to 1.2.2.Final (WELD-2487)

      • Eliminates another bunch of illegal access problems

  • Probe development tool

    • Probe now uses JDK-agnostic Annotation.toString() version (WELD-2463)

    • Correction to licences in Probe (WELD-2480)

  • Docs

    • WeldTerminalListener had wrong FQCN in our documentation which resulted in errors when trying to use it in Tomcat (WELD-2486)

    • Newly added memory-saving option ConfigurationKey.ALLOW_OPTIMIZED_CLEANUP is documented (WELD-2472)

      • If you wish to learn more, please glance here

      • Please note that integrator has to allow for this optimization, otherwise your settings won’t count (psst, WildFly 12 allows this!)

WildFly Patch

As usual, a patch for WildFly 12.0.0.Final is available. Please note that Weld 3.0.4.Final will still allow you to boot up WildFly in either EE 7 or EE 8 mode, whichever you prefer.

If this is the first time you hear about EE 8 mode for WildFly, check this post.

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


Weld 2.4.7.Final

2018-3-20   release   Matej Novotny

Weld 2.4.7.Final is now available. It includes multiple important bugfixes, many of them focused around proxy generation and/or invocation.

Note
Weld 2.4 now enters maintenance mode - there will be no further active development on Weld 2. We will be channeling our efforts into Weld 3 instead.

Notable fixes and improvements:

  • Weld Core:

    • Proxy-related issues:

      • Fixed possible NPE with multiple deployments one of which uses relaxed construction configuration (WELD-2448)

      • BeanManager.getInjectableReference was using unnecessarily strict checks for proxyability (WELD-2466)

      • Proxy serialization is now container agnostic (WELD-2447)

      • Fix invocation of private observer method (WELD-2443)

        • This only applies to private observer method which is not intercepted but is declared on a bean which has some other intercepted methods

      • Correct proxy generation for class hierarchy with abstract class and generics (WELD-2470)

    • Other issues:

      • Minor optimization in internal structures of InterceptionModel (WELD-2455)

      • Improve exception logging for DeploymentException (WELD-2453)

      • Prevent NPE if ProtectionDomain.getPermissions() returns null (WELD-2464)

  • Weld SE

    • Fields in org.jboss.weld.environment.se.Weld are now protected (WELD-2451)

    • Allow to register custom BeanArchiveHandler using ServiceLoader mechanism (WELD-2450)

      • This applies to SE and Servlet environments

  • Other

    • With OSGi, javax.ejb is now imported optionally (WELD-2458)

    • Weld now uses SpotBugs (a successor to FindBugs) (WELD-2462)

    • module-info, if present, is now correctly ignored during bean discovery phase (WELD-2459)

WildFly Patch

As usual, a patch for WildFly 11.0.0.Final is available. If you’re not familiar with patching WildFly, check the FAQ.


Weld 3.0.3.Final

2018-2-9   release   Matej Novotny

How do you cook Weld 3.0.3.Final? You start with a speck of bug fixes add some proxy generation improvements top it off with adjustments for integrators.

Notable fixes and improvements:

  • Weld Core

    • Fixed invocation of private observer method in some very specific cases (WELD-2443)

    • Container agnostic proxy serialization (WELD-2447)

    • Improve shared proxy class instantiation for multiple deployments with relaxed construction enabled (WELD-2448)

    • beans_1_1.xsd is now known to Weld once again (WELD-2445)

    • module-info is now ignored during discovery and won’t give you warnings in log (WELD-2459)

    • Enhanced logging of DeploymentException, it should now be possible to glance more from suppressed exceptions (WELD-2453)

  • Weld SE && Servlet

    • You can now register additional BeanArchiveHandler via ServiceLoader (WELD-2450)

    • Multitude of fields/method in Weld SE builder are now protected and hence extendable (WELD-2451)

  • Other

    • Improvements in documentation (WELD-2449)

    • Weld project now uses SpotBugs instead of FindBugs (WELD-2462)

    • OSGi now requires javax.ejb only optionally (WELD-2458)

WildFly Patch

As usual, there is a patch for WildFly 11.0.0.Final is available.

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