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

Jetty embedded + Jersey + Weld

I'm trying to implement (into Java SE) a standalone embedded web server, exposing REST application with CDI support. I followed up a simple tutorial at this link https://techunity.de/blog/integrate-a-rest-service-into-a-standalone-java-application/,…
0
votes
0 answers

CDI Injection of HttpServletRequest outside of RequestScoped bean - fallback or null field?

First: I know this problem actually requires a redesign of the application, which will be done later, but first I am looking into a short-term workaround. Framework: Java EE 7. Problem: I have a service which injects HttpServletRequest to read 1…
Bossk
  • 707
  • 8
  • 24
0
votes
0 answers

Getting WELD-001408 errors while doing jboss migration from 6.4EAP to 7.4EAP

Getting below errors after jboss migration from 6.4eap to 7.4eap same EAR/WAR is working on 6.4eap but giving errors on 7.4eap. As part of migration do we need to take care anything else to fix below issue? Caused by:…
devops
  • 1
  • 4
0
votes
0 answers

Memory leak, connection pool full; Question: with dao's in cdi (weld): when are connections closed?

My question is: if you work with dao's in cdi (weld), in weblogic e.g., when are connections opened and closed? We use session beans, container managed transactions. We see: weblogic.jdbc.extensions.PoolLimitSQLException:…
ericj
  • 2,138
  • 27
  • 44
0
votes
1 answer

Cannot inject dependencies when executing Hibernate Interceptor - Wildfly/CDI

I'm implementing an EmptyInterceptor from Hibernate to audit the DB changes. The problem is that all dependencies injected (@Inject) are null, inside the Interceptor and inside any other class that gets instantiated with new() operator when inside…
gutors
  • 43
  • 7
0
votes
1 answer

Is there any way to retrieve the session id from a CDI interceptor?

I have created a standard CDI (WELD) interceptor to log method calls: @MyInterceptorBinding @Interceptor public class MyInterceptor implements Serializable { @AroundInvoke public Object interceptMethod(InvocationContext ctx) throws…
0
votes
1 answer

Injecting a CDI interceptor into a beans does not work

I have created a CDI (WELD) interceptor that works and intercept what it is supposed to intercept. @MyInterceptorBinding @Interceptor @Dependent public class MyInterceptor implements Serializable { private int myIntegerField; …
0
votes
2 answers

is there a way to intercept all methods of all beans in CDI without touching their definition?

I would like to write a tool able to intercept all the method calls during the usage of an application that use CDI (Weld). I have already tried with CDI interceptors, however, since I want to keep the beans unawares of the interceptor, I do not…
0
votes
1 answer

wildfly-preview-25.0.0.Final - ERROR Module "org.jboss.weld.core" version 3.1.5.Final

Trying to move from wildfly-25.0.0.Final (Jakarta EE 8 Full) to wildfly-preview-25.0.0.Final (Preview EE 9.1). After adding my: org/hibernate/ ... org/jboss/ ... I have WELD: org/jboss/weld/3.1.4 ... org/jboss/weld/4.0.0.Final ... Error "Failed to…
NOTiFY
  • 1,255
  • 1
  • 20
  • 36
0
votes
0 answers

CDI module in EJB-jar deployed in an EAR

I have the following setup: EAR app.war (WAR module) @Inject SomeService --> works! depends on ejb ejb.jar (EJB module) @Stateless SomeServiceBean @Inject Foo --> does not work beans.xml, bean-discovery-mode="all" depends on tools MANIFEST:…
MaNa
  • 51
  • 6
0
votes
1 answer

CDI Conditionally produce/override a bean if a JNDI resource is present

I'm trying to find a way to conditionally produce an @Alternative/@Specialized bean in CDI 1.2 if a given JNDI resource is present. My use case is that I have a default bean which uses an in-memory data structure. However, if a given JNDI resource…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
0
votes
1 answer

Configuring Weld's threadpool in Wildfly 19

How can I configure the size of the executor service the Weld subsystem of Wildfly uses to execute asynchronous event observer methods? Specifically I want to increase the size of the thread pool. The Weld documentation has some config parameters…
Johannes Hahn
  • 363
  • 3
  • 18
0
votes
1 answer

java: jakarta.inject.Provider.get() is defined in an inaccessible class or interface

I am trying to use dependency injection within my Java (SE) FX application but I am getting the error java: jakarta.inject.Provider.get() is defined in an inaccessible class or interface when using the following code. @Log4j2 public class Main…
Tony Stark
  • 2,318
  • 1
  • 22
  • 41
0
votes
2 answers

How to pass command line arguments to a weld container?

I have a application which is started via command line like java -jar MyAssembledJarWithAllDep.jar -foo bar I am using weld.se to be able to use the jakarta ee cdi specification. Furthermore I am using the apache cli tool to parse the comman line…
Wumba
  • 99
  • 1
  • 12
0
votes
1 answer

How to ensure a Java CDI framework implementation will inject an instance at a custom injectionpoint of a custom bean?

Given that: I am using Weld as my underlying CDI framework implementation. I have a class ClassWithoutControl without a no-arg constructor (a.k.a. not a valid Bean). I create a custom Bean for that class. I add this bean via an Extension when a…
Byebye
  • 934
  • 7
  • 24