Skip navigation

The target platform for CDI (JSR-346) is Java EE. However, Weld also supports Tomcat and Jetty servlet containers for a long time (even if the level of support is limited). Up to now, Weld was using the "flat deployment structure", i.e. all bean classes shared the same bean archive and all beans.xml descriptors are automatically merged into one. Thus alternatives, interceptors and decorators selected/enabled for a bean archive were enabled for an application. Of course, this is not correct per the spec. Moreover, CDI 1.1 introduced new types of bean discovery for implicit bean archives - bean-discovery-mode of annotated and none (see also Section 15.6, “Packaging and deployment” and Bean archives in CDI 1.1). Weld Servlet did not support this either and so all classes were always discovered.

Since version 2.2.5.Final, the bean archive isolation is enabled by default. So the only way to select/enable alternatives, interceptors and decorators for an application is to use @javax.annotation.Priority. Also implicit bean archives with bean-discovery-mode of annotated and none are handled correctly. As a bonus, Weld Servlet supports the use of Jandex bytecode scanning library to speed up the scanning process - simply put the jandex.jar on the classpath.

We are aware that the bean isolation could break some old applications. Therefore, the default behaviour can be changed (enforcing the use of the "flat deployment structure") by setting the servlet initialization parameter org.jboss.weld.environment.servlet.archive.isolation to false:


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns=""



Note that there is no such option to disable the implicit bean archive support.

Filter Blog

By date:
By tag: