The beans.xml file is the bean archive descriptor for CDI applications. It can be used for any CDI compliant container, such as Weld which is included in WildFly application server.
CDI is a set of services that, used together, make it easy for developers to use enterprise beans along with JavaServer Faces technology in web applications. Designed for use with stateful objects, CDI also has many broader uses, allowing developers a great deal of flexibility to integrate various kinds of components in a loosely coupled but typesafe way
CDI Interceptors Decorators and Alternatives tutorial
In this tutorial we will learn three features of CDI programming: Interceptors, Decorators and Alternatives. All these features allow you to perform a separation of concerns in your applications in a type safe manner through annotations.
How to inject JPA resources with CDI
This tutorial shows how you can integrate Context Dependency Injection (CDI) to produce resources for JPA Applications. We will also learn how to handle multiple Database resources through CDI annotations.
Context Dependency Injection with JBoss Weld
Contexts and Dependency Injection (CDI) (JSR 299) defines a set of services for the Java EE environment that makes applications much easier to develop. It provides an architecture that allows Java EE components such as servlets, enterprise beans, and JavaBeans to exist within the lifecycle of an application with well-defined scopes.
Building a CDI 2 standalone Java application
In the second article about CDI 2 we will learn how to create a standalone J2SE application featuring CDI2. Let’s get started! Using Context Dependency Injection for J2SE application is something not totally new to developers. For example,before CDI 2 you could start-up the Weld CDI container using the specific classes provided by it. This … Read more
Introduction to CDI 2.0 API
CDI 2.0 is the new version of Context and Dependency Injection for the Java EE Platform and it’s now in public review status. While you can now grab the specification at: https://jcp.org/aboutJava/communityprocess/pr/jsr365/index.html in this tutorial we will have a first look on running some of its features on the last version of WildFly 10 CDI … Read more
Using CDI Beans in JBoss – WildFly modules
The building blocks of the application server are modules which are, often, Java libraries which can be run out of the application server context. It is however possible to deploy CDI Beans or use AS Resources in your modules. Let’s see how. In our example project, we will use a Java class which contains CDI … Read more
CDI faqs and common issues
Weld BootstrapService exception If you are starting to practice with CDI on Weld container, a common obscure exception that you might get is the following one: JBAS014775: New missing/unsatisfied dependencies: service jboss.deployment.unit.”jmsdemo.war”.WeldBootstrapService (unavailable) dependents: [service jboss.deployment.unit.”jmsdemo.war”.CdiValidatorFactoryService, service jboss.deployment.unit.”jmsdemo.war”.component.”javax.faces.webapp.FacetTag”.WeldInstantiator, service jboss.deployment.unit.”jmsdemo.war”.component.”javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV”.WeldInstantiator, service jboss.deployment.unit.”jmsdemo.war”.component.”com.sample.Test”.WeldInstantiator, JBAS014799: … and 10 more ] service jboss.deployment.unit.”jmsdemo.war”.WeldStartService (unavailable) dependents: [service jboss.deployment.unit.”jmsdemo.war”.CdiValidatorFactoryService, service jboss.deployment.unit.”jmsdemo.war”.component.”javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV”.WeldInstantiator, … Read more
Accessing ServletContext and ServletRequest in CDI Beans
Today I’ve found one interesting question on StackOverFlow of one user asking to read the web.xml context params from a CDI Bean. Luckily it’s not complicated at all to accomplish this task. In order to be able to read the web.xml context-params from a CDI Bean all you need to do is injecting the ServletContext … Read more
Java EE 6 CDI example application
In this tutorial we will show how to upgrade our Java EE 6 EJB based application into a CDI based application using Eclipse and Eclipse Maven plugin. Contexts and Dependency Injection(CDI) is a new addition to the Java EE specification as of Java EE 6. It provides several benefits that were missing to Java EE … Read more