Questions tagged [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)

See http://seamframework.org/Weld

592 questions
5
votes
1 answer

EJB and CDI inject points in @FacesValidator and @FacesConverter fail to work by means of OmniFaces in newer versions of JSF

I was using, Mojarra 2.3.0-m01 OmniFaces 2.0. PrimeFaces 5.1 final PrimeFaces Extension 3.0.0 GlassFish Server 4.1 And other Java EE artifacts. Injection points in @FacesValidator like as follows, @FacesValidator(value="testValidator") public…
Tiny
  • 27,221
  • 105
  • 339
  • 599
5
votes
1 answer

Why does Weld in GlassFish 4.1 call @PreDestroy method on already destroyed ViewScoped beans after call to invalidateSession?

I noticed this morning that my JSF application running on GlassFish 4.1 was throwing the following error when my users log out of the web application: WELD-000019: Error destroying an instance null of Managed Bean [...MyAuthenticator] with…
Reed Elliott
  • 223
  • 2
  • 15
5
votes
1 answer

WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this type

I'm running an application in the following environment. GlassFish Server 4.0 Mojarra 2.2.4 PrimeFaces 4.0 final PrimeFaces Extension 1.1.0 OmniFaces 1.6.3 After adding OmniFaces, the following warnings appear on the server terminal. WARNING: …
Tiny
  • 27,221
  • 105
  • 339
  • 599
5
votes
2 answers

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 instance of the sessionscoped cdi bean (i.e. the one in the sessionscope of the caller) should be used. I know that I can solve this with a…
Korgen
  • 5,191
  • 1
  • 29
  • 43
5
votes
1 answer

BeanManager on Apache Tomcat 7.0.47 cannot create resource instance

running on: Apache Tomcat 7.0.47 OmniFaces 1.6.3 JSF Mojarra 2.1.26 CDI Weld 2.1.0.Final Threre is an RuntimeException on Apache Tomcat 7.0.47 by accessing JNDI "java:comp/BeanManager". The CDI BenManager is bound to "java:comp/env/BeanManager" vut…
user2967758
  • 53
  • 1
  • 4
5
votes
1 answer

CDI Producer and Injection

i want to use a producer in my application but i'm stuck at the point, where i'm trying to inject the bean. im getting the famous WELD-001409 error. please lighten up my understanding of cdi producer. here's my interface: @Named public interface…
VWeber
  • 1,261
  • 2
  • 12
  • 34
5
votes
1 answer

Advantage of using JAX-RS 2.0 with CDI/Weld instead of Guice?

One goal of JAX-RS 2.0 was to integerate CDI and substitute the old @Context with the common @Inject injection. But if I look at the JSR 339 this is not mentioned. So what is actually the CDI integration? Would there be any advantage of using JAX-RS…
deamon
  • 89,107
  • 111
  • 320
  • 448
4
votes
5 answers

WFLYEE0047: Incompatible conflicting binding at

Got wired exception for very simple EJB with @Remote annotated interface in time of deploy to WildFly 17.0.1.Final @Stateless public class UserServiceImpl implements UserServiceRemote { @Override public List getAllUsers() { …
Alexey Usharovski
  • 1,404
  • 13
  • 31
4
votes
1 answer

How to use CDI to inject into an object instantiated by 3rd party

I have a class that is instantiated by 3rd party code (it uses reflection to create the object.) I provide the implementation of their interface and they create the object. In my implementation I want to use CDI to inject a service that performs…
Aaron L
  • 43
  • 4
4
votes
2 answers

Register CDI interceptor without using beans.xml

I am searching for a way to load a given interceptor programmatically. I've seen a way to dynamically set an interceptor binding for a given bean, but the interceptor for that binding must be defined in the beans.xml. I know I can use the…
Miro
  • 63
  • 5
4
votes
2 answers

Clean way of injecting/checking for presence of a HttpServletRequest with CDI from code that can be called outside a request?

I have a piece of code that can be called both within and outside a HTTP request, but wants to access information in the HttpServletRequest if it is available. My first attempt was the following: @Inject private Instance
John Smith
  • 51
  • 2
4
votes
1 answer

@Produces @Named gives a WELD-001408

I'm trying to get my head around CDI and in this case the annotations @Produces and @Named I have the following code @RunWith(CdiRunner.class) public class cdiTest { @Inject protected CDIModel em; @Test public void injectionTest(){ …
stuf99
  • 95
  • 6
4
votes
3 answers

WebSocket endpoint and CDI injection: No active contexts for scope RequestScoped

I want to inject a @RequestScoped CDI bean in my Java EE 7 WebSocket endpoint. However I am getting error WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped. What am I doing wrong and why it is not…
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165
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
0 answers

Arquillian injected Weld Bean in EJB is null

I am succesfully running EJB tests with Arquillian against an (older) Glassfish 3.1 embedded. When trying to @Inject weld beans, I get a NPE when I want to address a method in a transitively injected Weld bean. So, I am testing EJB A. EJB A has a…
Coen Damen
  • 2,009
  • 5
  • 29
  • 51