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.

Why @Singleton over @ApplicationScoped in Producers?

LoggerProducer.java is a class used to produce Loggers to be injected in CDI beans with: @Inject Logger LOG; Full …

java jakarta-ee thread-safety cdi ejb-3.1
Why do I need a no-args constructor to use ApplicationScoped beans with Constructor injection within CDI?

I'm trying to apply the constructor injection pattern to beans in my CDI application and am encountering the following error …

java jakarta-ee dependency-injection cdi weld
View Scope in CDI Weld

I want to use the @ViewScoped - scope in my application for the backing beans of some web pages. Also …

scope cdi jboss-weld
Dynamically fire CDI event with qualifier with members

I'm trying to use CDI events in my backend services, on JBoss AS6 - ideally with maximum code reuse. I …

events cdi jboss-weld
Will Spring support CDI?

Spring has been a good framework for DI and AOP for Java developers. Now, there comes a standard specification for …

spring jakarta-ee dependency-injection aop cdi
Inject @SessionScoped CDI Bean to @Stateless EJB

I'd like to inject a sessionscoped CDI bean into a stateless EJB. At access time of the EJB the correct …

jakarta-ee ejb cdi glassfish-4 weld
Memory leak with ViewScoped bean?

In our JavaEE6 project (EJB3, JSF2) on JBoss 7.1.1, it seems we have a memory leak with SeamFaces @ViewScoped. We made …

jsf-2 memory-leaks cdi seam3 view-scope
How to bootstrap weld-se in a JUnit test

I have a maven project for unit tests and would like to use CDI. I've put the weld-se dependency in …

java junit cdi weld
Injecting a stateless EJB into Servlet

I'm trying to inject a stateless EJB into servlet. But it is not working. Did I understand something wrong? If …

servlets ejb cdi inject
CDI object not proxyable with injected constructor

When trying to inject arguments into the constructor of a CDI bean (ApplicationScoped), I'm encountering the following issue: Caused by: …

java dependency-injection cdi weld