View source | View content page | Page history | Printable version   

Projects:Upgrade Weld/Specs

Back button.png   Back to Projects:Upgrade_Weld



Weld is the implementation of CDI: Contexts and Dependency Injection for the Java EE Platform used in Openbravo.

The main objective of this project is to upgrade the Weld library from current 1.1.24 version to the newer 3.1.0.

Functional Requirements

This project will not add new functional features, the changes involved within this project should be transparent in terms of the functional behavior of the application.

Technical Specs


Weld version 1.1.24 is an implementation of CDI 1.1 (JSR-346). With this project we are upgrading to CDI 2.0 (JSR-365) with the upgrade of Weld to the latest available version, 3.1.0.

Assignability Rules

CDI 2.0 defines under which circumstances the assignability of raw and parameterized types works within an injection point. This is specified with a set of rules defined here.

Weld version 1.1.24 was not adhering to these rules and thus it allowed to define some injection points which are no longer valid using Weld 3.1.0.

This change affects to some parts of the existing code which are making use of dependency injection. See the QA-Test Plan section for further details.

Weld Library Management

For upgrading Weld, the standard library upgrade process must be applied.

Apart from replacing the old libraries with the new ones, this upgrade implies some other changes regarding library management:

More information about the Weld library upgrade process can be found here.

Web Containers

It must be ensured that after the upgrade the application continues working in all the supported web containers.

In this sense, it is important to note that Wildfly requires to exclude the Weld libraries from the deployment. This is because Weld is part of the core WildFly's infrastructure as it implements Java EE 7 specifications. If the Weld libraries included in Openbravo are deployed in WildFly, there are clashes (due to different versions) that prevent the server to boot the application. The existing mechanism to exclude these libraries when deploying Openbravo in Wildfly must continue working.

Test Infrastructure

Openbravo uses arquillian to support CDI within jUnit test cases. The arquillian libraries will also be updated to the latest version available (1.4.1).

This new version requires:

Weld Development Mode

After the upgrade, it would be possible to enable the Weld Development Mode which is an special mode that provides several built-in tools suitable for development and testing purposes. By default this mode will be disabled. It should never be used in productive environments because it may have a negative impact on performance.

The Weld Probe is one of these Development Mode tools. Although this tool is included in a separate library which is a dependency of weld-servlet, it is an optional tool.

For this reason we are not going to include the Probe library in core but in a module that contains several Weld testing/development features. This module can be used to enable automatically the Development Mode and because of the mentioned reasons, this module should only be installed in development environments.

Retrieved from ""

This page has been accessed 777 times. This page was last modified on 8 April 2019, at 15:22. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.