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
4
votes
5 answers

Weld (CDI): where do I put my test-only beans.xml that configures ?

My webapp has a non-empty production beans.xml under src/main/resources/META-INF. Now, for my tests, I need to swap out 1 bean with an alternative. Where do I put this test beans.xml which contains just this and nothing more?
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
4
votes
2 answers

Why does CDI injection fail to work in a some modules, but not in others?

In my Java EE project, there are several "Java EE" modules and a web module. One of the Java EE modules provides a class to CDI that is to be used by the other modules: @ApplicationScoped public class XFactory { @Produces @Actual public X…
Urs Reupke
  • 6,791
  • 3
  • 35
  • 49
4
votes
1 answer

TestNG - injection fails when using any @Before* annotation but works without

I would like to use the @Inject annotation in my TestNG test case. The test is executed by Arquillian in a remote JBoss AS 6 instance. The test basically looks like this: Test case public class WorksheetControllerTest extends Arquillian { …
Sebastian Wramba
  • 10,087
  • 8
  • 41
  • 58
4
votes
2 answers

JavaEE and CDI: Understanding @Observes

I have the archetype org.jboss.weld.archetypes:jboss-javaee6-webapp:1.0.1.CR2 and I try to understand the class MemberListProducer: @RequestScoped public class MemberListProducer { @Inject @MemberRepository private EntityManager em; private…
Thor
  • 6,607
  • 13
  • 62
  • 96
4
votes
2 answers

Using JAX-RS (RESTEasy) with CDI (Weld) in Tomcat 7

In a JSF 2.0 application (running on Tomcat 7 and using weld 1.1.1.Final), I want to propose my user to download some binary files (.doc, .pdf etc). In order to fulfil that need, I want to use a JAX-RS (RESTEasy 2.2.0.Final) resource bean (annotated…
Anthony O.
  • 22,041
  • 18
  • 107
  • 163
4
votes
2 answers

CDI WELD @ConversationScoped @Stateful EJB conversation.end() & @Remove SFSB

currently i am trying to remove a ConversationScoped Stateful Session Bean (SFSB). The ConversationScope is managed by the CDI Container and the lifecycle of the SFSB is managed by the EJB Container. Is this correct? In my Controller i'm trying to…
ich-bin-drin
  • 543
  • 3
  • 12
  • 23
4
votes
2 answers

How to inject ConversationScoped beans in a Servlet

I need to inject a ConversationScoped bean into a servlet. i use the standard simple @Inject tag and I invoke the servlet with the cid parameter but when it invokes any method in the injected bean I get the following…
icordoba
  • 1,834
  • 2
  • 33
  • 60
4
votes
1 answer

How does CDI injection work in MDBs and @Scheduled beans?

I'm working on a large Java EE 6 application that is deployed on JBoss 6 Final. My current tasks involve using @Inject consistently instead of @EJB, but I'm running into some problems on some types of beans, specifically @MessageDriven beans and…
4
votes
0 answers

Weld with Tomcat : WELD-000714, WELD-000715, WELD-000335

I am using WELD 2.4.1.Final for my web application running on Tomcat 7. I am having JSF and Jax-RS Rest services in my web application. I have implemented asynchronous JAX-RS Rest Services. Async Rest call works perfect, but in logs I got following…
Tarana
  • 119
  • 1
  • 9
4
votes
1 answer

Weld does not register @ViewScoped beans anymore after adding Hibernate and Jandex

I use CDI Weld container with JSF 2.2 flow. org.jboss.weld.servlet weld-servlet-core 2.2.11.Final
4
votes
1 answer

Weld OSGi + Apache Felix = can't find packages

I use Apache Felix and weld-osgi for a Java SE application. The problem is that in injected bean I use @ApplicationScoped from package javax.enterprise.context.ApplicationScoped. But there is no such package in weld-osgi-bundle-2.1.2.Final. This…
user3488102
4
votes
1 answer

JSF 1.2 on Wildfly 8 Final - weld-core-jsf is still referencing JSF 2.2 API

I'm currently migrating a JSF-1.2 app to Wildfly 8 Final and am stuck :( First of all, I've read many post with related issues (e.g. https://community.jboss.org/message/845006 or Migrate JSF 1.2 Seam app to WildFly Beta 1) but the proposed solution…
shillner
  • 1,806
  • 15
  • 24
4
votes
1 answer

Information on @Inject in CDI/Weld and DI/Guice

I'm trying to discern (some of) the difference's between CDI and DI. What does CDI(JSR-299)'s bring over just DI's (JSR-330) with respect to @Inject? Is it true that CDI @Injects (just like DI), however the lifecyle of what it has injected, is tied…
johnm
  • 7,327
  • 1
  • 24
  • 35
4
votes
1 answer

Using @Produces with @Qualifier

Is there any way to force the use of producer method if using @Qualifier? I have a @Produces factory method but the constructor is still being called, which is an issue because I need the InjectionPoint to read parameters. Using the code below…
user1889665
4
votes
1 answer

How to use qualifier on non default class with java cdi

I am trying to use @Qualifier to create an annotation on an Alternative class that will be used instead of the default class marked with @Default. However , when I do this weld reports the error. I am trying to inject demo.cdi.ProductB (the default…
user1889665