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
8
votes
2 answers

Hibernate makes Weld not initializing in Java SE

So, I have a basic Java SE program with dependency injection using Weld 1.2. Everything is working fine, until I throw Hibernate into the mix, with the following pom.xml dependency entries: javax
Wrench
  • 4,070
  • 4
  • 34
  • 46
8
votes
1 answer

WELD + GF4 + SessionScoped: Sometimes wrong bean?

TL;DR We get @SessionScoped bean instances injected that have the content of another session lately we have been experiencing serious problems with two of our customer systems. Our customers are running two independent instances of the same JSF…
marius.7383
  • 159
  • 1
  • 12
8
votes
1 answer

Understanding CDI/Weld in multi-module application

I have an application which is packaged in an EAR containing many JARs (with EJBs, libraries, 3rd-party-libraries, ...) and a single WAR (again containing some other JARs). The application is deployed in an JEE7 container (Wildfly 8.0.0.Final) and…
MrD
  • 1,255
  • 1
  • 10
  • 24
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
7
votes
1 answer

JPMS: --add-opens doesn't work for java.lang.reflect.InaccessibleObjectException

I use Java 14 with Jetty 9.4 and Weld-servlet-shaded-3.1 and I get this exception: Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class …
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
7
votes
3 answers

Unsatisfied dependencies with Weld during integration testing

I am able to deploy a RESTEasy application working well with Weld (meaning my CDI works) but I am having some trouble with my integration tests. I get this error: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies…
Maxime Laval
  • 4,068
  • 8
  • 40
  • 60
7
votes
1 answer

CDI: manual creating beans with constructor arguments

I have a class which I want to be a bean public class SomeBean{ public SomeBean(){ //default constructor } public SomeBean(String someStr){ //constructor with arguments. } } In order to create manually CDI bean I do the…
user2022068
7
votes
2 answers

Java CDI: Do interceptors have scope?

What is the scope of an interceptor in CDI? aka, is this legal? Would I get the same instance of this interceptor every place it's invoked? @RequestScoped public class SalesForceControllerInterceptor { @Inject private Logger log; …
Jonathan S. Fisher
  • 8,189
  • 6
  • 46
  • 84
7
votes
1 answer

CDI/Weld unable to do constructor injection of RESTEasy resource

I'm trying to combine RESTEasy with Weld on AppEngine but having troubles to do constructor injection. I've added the RESTEasy CdiInjectorFactory context param and the Weld servlet listener. My RESTEasy application class looks like: public class…
Marcel Overdijk
  • 11,041
  • 17
  • 71
  • 110
7
votes
3 answers

Why Weld says "Injection into Listeners is not supported" on Tomcat?

I have a web project using Resteasy (which in turn uses Weld) and is deployed to Tomcat 7.0.22 (I put the specific version here in case this issue is particular to this version). I have a ServletContextListener that looks like…
stackoverflower
  • 3,885
  • 10
  • 47
  • 71
7
votes
1 answer

Why is the interceptor not called in the same service class?

I want to use interceptors in a Java-SE application and I am using weld as CDI implementation and i'm testing this here: The Main-Class: public static void main(String[] args) { WeldContainer weldContainer = new Weld().initialize(); …
Qri
  • 227
  • 3
  • 11
6
votes
0 answers

Location of beans.xml during unit tests of a Maven web app

I use Deltaspike CdiControl to start up the CDI container for my unit tests. That works fine but there is a problem: If I use this approach for Maven web app the beans.xml end up in src/main/webapp/WEB-INF. That means it is not in the META-INF…
fhossfel
  • 2,041
  • 16
  • 24
6
votes
1 answer

Seed value in Weld CDI custom scope

Coming from a Guice background, I know that it is possible to seed an object value from a scope using. scope.seed(Key.get(SomeObject.class), someObject); I suppose one could do this by registering a Bean that gets a value from an…
6
votes
1 answer

WildFly Swarm Nullpointer @Inject bean

I have a schedule service which gets its job via REST as JSON. The Resource class: import java.io.IOException; import javax.inject.Inject; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; import…
Marekzan
  • 93
  • 1
  • 9
6
votes
1 answer

CDI Conversation Bean - BusyConversationException

I have a Conversation scoped bean, ComponenteM, that is injected in a Request Scoped bean, ComponenteC. @Named @RequestScoped public class ComponenteC implements Serializable { @Inject ComponenteM componenteM; } ComponenteC has an export…
Rita
  • 1,233
  • 2
  • 14
  • 23
1 2
3
39 40