Top "Cdi" questions

Contexts and Dependency Injection (CDI): Java Platform, Enterprise Edition (Java EE) 5 brought dependency injection (DI) with Convention over Configuration to Enterprise JavaBeans (EJB) 3.0. Java EE 6 introduces the flexible and powerful @Inject dependency injection model (JSR-330 and JSR-299) in addition to the already existing @EJB annotation.

CDI Injection into a FacesConverter

From just a few searches, this seems like a problem that has been around for a while. I have written …

jsf-2 cdi myfaces
Why different persistence units with separated data sources query the same data source?

I'm developing a webapp which needs access to two different database servers (H2 and Oracle). The container is an Apache …

java jakarta-ee jpa cdi jta
Using CDI in a singleton pattern

I'm trying to inject a logger object in a class that is implemented following a singleton approach. The code almost …

java dependency-injection singleton cdi
No active contexts for scope type javax.enterprise.context.RequestScoped when invoking a bean from a thread

While using Weld-SE 2.1.2.Final to obtain a bean and to invoke it from a thread, I encounter the following exception: …

java multithreading cdi weld-se
Google Guice vs. JSR-299 CDI / Weld

Weld, the JSR-299 Contexts and Dependency Injection reference implementation, considers itself as a kind of successor of Spring and Guice. …

java dependency-injection aop cdi jboss-weld
Getting a reference to EntityManager in Java EE applications using CDI

I'm using Java EE 7. I would like to know what is the proper way to inject a JPA EntityManager into …

java jpa cdi entitymanager java-ee-7
How to manage EntityManager life-cycle in CDI environment (using Tomcat)

I am developing one application and I have started to use CDI along with JSF and JPA. The web container …

java hibernate jakarta-ee jpa cdi
What is the default scope of a Named CDI bean?

Is there any default scope for a @Named CDI bean without additional @...Scoped annotations? I have not found any relevant …

java dependency-injection cdi jboss-weld named
JEE7: Do EJB and CDI beans support container-managed transactions?

Java EE7 consists of a bunch of "bean" definitions: Managed Beans 1.0 (JSR-316 / JSR-250) Dependency Injection for Java 1.0 (JSR-330) CDI 1.1 (JSR-346) …

java jakarta-ee ejb cdi jta
Inject a stateless EJB with @Inject into CDI Weld ManagedBean (JSF 1.2 EJB Application on jboss 6 AS)

Currently I am trying to inject a stateless EJB into a CDI managed controller on Jboss 6 AS Final. The controller …

dependency-injection cdi ejb-3.1 jboss-weld