4,051 questions
0
votes
0
answers
41
views
How to inject in cdi a runtime object?
I have the following code:
@WebServlet("/produces")
public class TestProducesServlet extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) ...
1
vote
1
answer
83
views
Why when bean-discovery-mode="annotated", @Dependent is not the default scope?
In the weld 3.1 documentation in par. 5.5 it says:
Finally, CDI features the so-called dependent pseudo-scope @Dependent. This is the default scope for a bean which does not explicitly declare a scope ...
Advice
0
votes
5
replies
118
views
Jakarta CDI - Two "Singletons" of the same class
I'm new to injection frameworks. And my question is a contradiction in itself, but - hypothetically - is it possible to have CDI inject exactly 2 different instances of the same class throughout my ...
1
vote
1
answer
109
views
ContextNotActiveException when invoking @Repository during sessionDestroyed
I'm working on a Primefaces application; I'm trying to keep a registry in the DB of users' logging in and out. Using an HttpSessionListener I have managed to record the login, and if the user logs out ...
0
votes
1
answer
60
views
JBeret SE, Weld SE and command line parameters
I am wondering how efficiently handle startup parameters. So far I used to do it in my public static void main(String[] args) method and taking it from there.
Now I want to combine both Java Batch and ...
1
vote
1
answer
61
views
Java Beans are not being created when not referenced by others directly in Weld
I have 2 providers which contains details about themselves and they are updating a ProviderDetails class which contains details of all the providers
class ProviderA{
@Inject
...
2
votes
1
answer
84
views
Do Specialised CDI beans no longer inherit scope?
So we are working on an project upgrade from JavaEE8 to JakartaEE10.
In the eventual war file, we have a lib as a jar that is an implicit bean archive (so no beans.xml). It contains this:
@Named("...
1
vote
2
answers
85
views
how to inject a primitive using WELD
I am following this tutorial on how to use Jakarta CDI:
https://jakarta.ee/learn/docs/jakartaee-tutorial/current/cdi/cdi-basic/cdi-basic.html#_injecting_objects_by_using_producer_methods
The problem ...
0
votes
1
answer
85
views
Scope of Produces method
I have unresolved question about CDI:
I have Producer class annotated with @ApplicationScoped and the @Produce method has no additional scope annotaion.
@ApplicationScoped
public class ...
0
votes
1
answer
28
views
Should CDI methods be overridden with annotations?
I defined an abstract class for producing persistence-related beans.
public abstract class __PersistenceProducer {
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType....
0
votes
0
answers
46
views
Liquibase CDI - JBoss
I wonder if anyone could help me finding out why I am unable to get liquibase running automatically on JBoss upon deployment?
The example code below generates an “ear” and i think it should update the ...
0
votes
0
answers
100
views
Mojarra throws "CDI is not available" when using embedded Jetty instead of standalone Jetty
I'd like to use Jakarta Faces' reference implementation Mojarra 4.0 using embedded Jetty 12.0.22 and Java 21.0.7 since Jetty does not meet the requirements for Faces/Mojarra 4.1 yet, like Jakarta EE ...
0
votes
0
answers
38
views
SpringBoot - JSF - injection
I migrated a project that was running on WebLogic to Spring Boot.
The front-end is written in JSF.
I have several converters declared in the faces-config.xml.
I have an issue with bean injection in ...
0
votes
1
answer
63
views
@SessionScoped not compiling with Kotlin interfaces in Quarkus
I am trying to develop an AI Agent using LangChain4J Quarkus plugin, in Kotlin.
I have created this class:
package prova.langchainkotlin.test
import io.quarkiverse.langchain4j.RegisterAiService
...
0
votes
1
answer
79
views
Is there a way to @Inject the SeContainer/CDI instance itself?
Is there a way to inject the SeContainer itself?
I am working on a Picocli CLI application where I create the instances of the commands by using CDI. I do not want to depend on a specific CDI ...