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

How to exclude a class from scanning with CDI 1.0

I would like to exclude a class from scanning in CDI 1.0. I'm using the default implementation of CDI in WebLogic 12.1.12 (Weld, CDI 1.0). I saw several web sites and docs with CDI 1.1 but not with the previous release .
Alexandre T
  • 648
  • 2
  • 8
  • 24
10
votes
2 answers

How to specify an @Alternative producer method in beans.xml?

Say I have: public interface Foo {...} public class AltProducer { private Foo altFoo; @Produces @Alternative public Foo getAltFoo() { return altFoo; } } What do I need to put in beans.xml so that my AltProducer's @Produces method will get…
Kricket
  • 4,049
  • 8
  • 33
  • 46
10
votes
3 answers

What is the alternative to OSGI for inter-module service injection in Wildfly?

We are in the process of disentangling a classic legacy monolithic EAR-packaged Java EE application. Our (most complex) component wiring pattern is as follows: component A 'requires' interface X, whilst components B and C (... N) each 'provide'…
Ampie Barnard
  • 678
  • 4
  • 11
10
votes
3 answers

WELD-001303 No active contexts for scope type javax.enterprise.context.SessionScoped

I have searched every where, but seem I cannot find out the best answer for me to resolved this error, there is my stack trace, can somebody tell me what happening with me, I have spent twos date to finding this error....:( 16:55:02,405 SEVERE…
Mike Nguyen
  • 1,024
  • 1
  • 11
  • 16
9
votes
2 answers

Exception using weld CDI with Jetty: Singleton not set for STATIC_INSTANCE

I am trying to configure Jetty with JSF and Weld CDI. After following this manual, I stumble upon the following stacktrace: Caused by: java.lang.IllegalStateException: Singleton not set for STATIC_INSTANCE => [] at…
9
votes
2 answers

Why is there a WELD-001408 even when the BeanManager knows the EJB

When trying to deploy an ear we get the infamous WELD-001408 (see below for stacktrace). Problem: It seems that WELD can't inject an EJB via @Inject into a CDI managed bean (!= @ManagedBean) in a lib/shared.jar. Why is this? Is there a standard that…
Benjamin Seiller
  • 2,875
  • 2
  • 32
  • 42
9
votes
1 answer

GlassFish 4.1 startup warnings: javax.ejb.PostActivate & javax.ejb.PrePassivate not found

Whenever I startup GlassFish 4.1, I get the following two warnings in my GlassFish log: WELD-001700: Interceptor annotation class javax.ejb.PostActivate not found, interception based on it is not enabled WELD-001700: Interceptor annotation class…
XDR
  • 4,070
  • 3
  • 30
  • 54
9
votes
4 answers

Weld not initializing properly

I am setting up basic environment for learning CDI in JavaEE7. I have the following code for starting Weld. Just a startup and shutdown. package com.anshbansal; import org.jboss.weld.environment.se.Weld; import…
Aseem Bansal
  • 6,722
  • 13
  • 46
  • 84
9
votes
1 answer

CDI Weld ignoring exclusions

I am using Weld SE to use CDI in my application. Since some libraries may have @Inject annotations and and don't want to let Weld scan all the libraries. Therefore I wanted to exclude certain package prefixes in beans.xml:
trichner
  • 840
  • 1
  • 11
  • 22
9
votes
2 answers

Inject producer method that returns String CDI

I would like to inject constant string message to managed bean in JSF web application using CDI, here is producer class: @Named @RequestScoped public class StringProducer { @Produces @Named("message") @RequestScoped public String…
Hoang Minh Tran
  • 109
  • 1
  • 10
9
votes
3 answers

CDI deployment failure:WELD-001414 Bean name is ambiguous

I have an application, which has multiple modules and various dependencies. When I deploy the application on Glassfish 4, I am getting error: org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean name is ambiguous. Name …
bilal
  • 103
  • 1
  • 1
  • 5
9
votes
4 answers

Are injected (@Inject) fields safely published?

When I use field injection in a class, like so: @Inject private MyClass myField; can I make any assumption about the "safe publication" status of this field? Or put differently, and assuming that MyClass itself is thread-safe, are there any…
HansMari
  • 347
  • 1
  • 2
  • 16
8
votes
2 answers

Required dependencies for Jersey / CDI 2.0 / Weld 3.0

I'm trying to updating my Jersey project from 2.25 to 2.27. Jersey is part of Java EE 8 since version 2.26, so I've also decided to update my project from Java EE 7 to Java EE 8, and from JAX-RS 2.0/CDI 1.x/Weld2.x/Apache Tomcat 8 to JAX-RS 2.1/CDI…
Raúl Ríos
  • 81
  • 1
  • 6
8
votes
1 answer

WARNING: Parameter 1 of type List> from public void org.omnifaces.cdi.eager.EagerBeansRepository.setXxx is not resolvable to a concrete type

I'm using Omnifaces 1.8.1 and Whenever I deploy my application to Glassfish I get the following warning which causes some delay in the deploy process. Warning: WELD-001519 An InjectionTarget implementation is created for an abstract class…
fareed
  • 3,034
  • 6
  • 37
  • 65
8
votes
4 answers

WELD-000227: Bean identifier index inconsistency detected - the distributed container probably doesn't work with identical applications

I am using tomcat v7 with Weld v2.2.9.Final and myFaces v2.2.7 after restart server in eclipse IDE and reload page I getting this error. I have no clue why this error appear to me. It has to be connected with http request or so. If I open close…
Milkmaid
  • 1,659
  • 4
  • 26
  • 39
1
2
3
39 40