Questions tagged [jboss-weld]

Weld is the reference implementation (RI) for JSR-299: Java Contexts and Dependency Injection for the Java EE platform (CDI)

Weld is the reference implementation (RI) for JSR-299: Java Contexts and Dependency Injection for the Java EE platform (CDI). CDI is the Java standard for dependency injection and contextual lifecycle management, a Java Community Process (JCP) specification that integrates cleanly with the Java EE platform. Any Java EE 6-compliant application server provides support for JSR-299 (even the web profile).

http://seamframework.org/Weld

See also

393 questions
10
votes
4 answers

Is it possible to destroy a CDI scope?

I'm working on a Java EE application, primarily JAX-RS with a JSF admin console, that uses CDI/Weld for dependency injection with javax.enterprise.context.ApplicationScoped objects. Minor debugging issues aside, CDI has worked beautifully for this…
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
10
votes
2 answers

Are CDI event observer methods compatible with EJBs?

I have a Singleton EJB (javax.ejb.Singleton version. sigh.) which has a CDI observer method on it. When I try to deploy this to glassfish 3.1 the server fails to deploy the EAR file without any real explanation - simply saying there was an exception…
jportway
  • 917
  • 8
  • 17
10
votes
1 answer

Performance impact of using CDI

I am writing a Java EE 6 web application and I am noticing a significant performance impact when using an injected object versus creating and using the object directly. The overhead appears to be of the order of 50 - 60ms per method call. For…
Troup
  • 573
  • 5
  • 17
10
votes
1 answer

CDI injection in EntityListeners

Since JPA 2.0 does not support injection into EntityListener (JPA 2.1 will), decided to use JNDI lookup to get the BeanManager and through it get the logged in user. I defined an EntityListener similar to this: public class MyEntityListener { …
Uluk Biy
  • 48,655
  • 13
  • 146
  • 153
9
votes
3 answers

CDI/Weld: book or resource recommendation

Is there an existing, or upcoming book on CDI/Weld that you can recommend? I'm looking for something that's similar in scope and quality to Seam in Action, which was a great reference for Seam, but now seems a little dated.
George Armhold
  • 30,824
  • 50
  • 153
  • 232
9
votes
1 answer

Is there a way to know if a state is active without catching ContextNotActiveException?

I would like to know if the RequestScoped context is currently active in a method or not. At the moment, here is what I do : @Inject private BeanManager beanManager; public boolean isRequestScopeActive() { try { if…
Anthony O.
  • 22,041
  • 18
  • 107
  • 163
8
votes
1 answer

Understanding cdi Instance<> and .get() vs @Inject

I'm a little confused about which to use in the following situation: Suppose the servlet creates an Application that handles the user's http session, and the application is this: public class Application extends AbstractHTTPApplication…
Christopher Poile
  • 985
  • 1
  • 11
  • 17
8
votes
2 answers

How to use inheritance and lists of CDI events?

Is it possible to use type variance in CDI events? here is the case: Suppose i have a root event type MyEvent and subclass DummyEvent My goal is to process a list of events received from a remote source List, containing…
Julio Faerman
  • 13,228
  • 9
  • 57
  • 75
8
votes
3 answers

How to create and destroy CDI (Weld) Managed Beans via the BeanManager?

I'm trying to create instances of CDI managed beans using the BeanManager rather than Instance .select().get(). This was suggested as a workaround to an issue I've been having with ApplicationScoped beans and garbage collection of their dependents…
Ben Kirby
  • 904
  • 2
  • 11
  • 29
8
votes
6 answers

"Exception while loading the app" without a stack trace

I'm migrating my app from GlassFish 3.0.1 to GlassFish 3.1.1. Deployment fails, with the following error messages: SEVERE: Exception while loading the app SEVERE: Exception while shutting down application container SEVERE: Exception while shutting…
Nick
  • 2,827
  • 4
  • 29
  • 39
8
votes
5 answers

jsf viewparam lost after validation error

I'm facing the following issue: in one page, I list all users of my application and have an "edit" button for each one, which is a "GET" link with ?id=. The edit page has a in metadata.…
DenisGL
  • 1,190
  • 1
  • 16
  • 31
8
votes
3 answers

Using CDI instead of @ManagedBean: UnproxyableResolutionException because super class has no no-args constructor

I'm trying to use CDI for my JSF/Java EE application. I have the following class hierarchy: /** * base controller class * also contains some final methods and an inner enum class declaration */ public abstract class AbstractCrudController
Theo
  • 3,074
  • 7
  • 39
  • 54
8
votes
3 answers

How to unit test CDI with weld-se?

I want to use weld-se for unit testing CDI. However, I am stuck with this problem that Weld cannot resolve beans. I created a mini-project to demonstrate the problem with gradle for building. I have the following files in the
JBT
  • 8,498
  • 18
  • 65
  • 104
8
votes
3 answers

what is the purpose of including empty beans.xml in CDI implemenations projects?

I am using weld,a RI of CDI as dependency injection component in my JSF-EJB-JPA web app. I see in my project we have empty beans.xml in META-INF/beans.xml in ejb.jar and WEB-INF/beans.xml in my WAR. I don't get it why we need to keep empty…
SRy
  • 2,901
  • 8
  • 36
  • 57
8
votes
4 answers

CDI injection is not working in Servlets

I really need your help. I'm working on this problem for weeks or months now. I apologize for the long post, but I want to explain the problem and my settings as precisely as possible. My JAVA EE 6 web application mainly contains 3 Servlets: a…
Sebastian S.
  • 1,545
  • 6
  • 24
  • 41
1 2
3
26 27