Most voted "cdi" questions
CDI or Context and Dependency Injection (<a href="https://jcp.org/en/jsr/detail?id=299">JSR 299</a>) is the Java EE specification for dependency injection and context control.
Learn more…85 questions
Sort by count of
-
12
votes2
answers4872
viewsWith the output of Viewscoped from the new JSF specification, what scope do I use now in my managed Beans that used it using JSF 2.2?
I have a big question now with the appearance of JSF 2.2: What to do with my views and my old Beans Managed? How to do it now (what scope to use) since I can no longer use view scoped in a view that…
-
7
votes2
answers455
viewsJAX-RS Resource as Session Bean or CDI Managed Bean?
Today I ran into an interesting problem trying to inject an EJB into a JAX-RS feature (in Glassfish 4.1, running the pre-installed version of Jersey). @Stateless public class MeuEJB implements…
-
6
votes1
answer1130
viewsCDI @Inject Named bean in another named bean
I am using jsf 2.2. I have 2 @Named @Named(value = "menuMB") @ViewScoped public class MenuMB implements Serializable{ } @Named(value = "produtoGeralMB") @ViewScoped public class ProdutoGeralMB…
-
6
votes3
answers720
viewsNullpointerexception Java JPA CDI Tomcat
Good afternoon guys. I am developing a Java test application with JPA, CDI and Tomcat. I created a basic test class and am getting the following error. Erro: Exception in thread "main"…
-
5
votes0
answers714
viewsProblem loading database image with JSF
I’m having a problem loading images from the database with JSF and CDI, below is the code for a better understanding of the problem. <ui:define name="titulo">Detalhes Anuncio</ui:define>…
-
5
votes1
answer347
viewsWhat is CDI technology?
I am developing a web application and a university colleague who is a few periods beyond what I am currently studying said that using CDI would have a better performance, however, until now had not…
-
4
votes1
answer512
viewsCan injecting dependencies into an EJB builder cause modularization and performance problems?
Recently I migrated from Spring to CDI + EJB, I tried to inject my dependencies directly into the constructor as I did in Spring and as it is supported by CDI but in an EJB: @Stateless public class…
-
4
votes2
answers252
viewsScope equivalent to @Stateless on CDI
I’m migrating the notes EJB from my application to CDI and I have some doubts: What is the equivalent scope @Stateless of the EJB at the CDI? The @ResquestScoped would act in an equivalent manner? I…
-
4
votes1
answer1465
viewsJavase with CDI and JPA - Error WELD-001303
I am studying JPA and CDI in a Java SE application. When I will create the EntityManagerFactory I come across the error: Exception in thread "main" org.jboss.weld.context.ContextNotActiveException:…
-
4
votes0
answers1609
viewsWeld CDI problem with Tomcat server
Greeting to everyone, I’m having trouble using the CDI implementation, Weld on Tomcat 7. I’ve been doing some research and tried several proposed solutions, but all these solutions are old, with…
-
3
votes2
answers1142
viewsConvert and Validator with CDI injection
Can someone inject CDI or EJB into JSF 2.2 Converter or Validator? It was said that from 2.2 it would be possible but I’m not getting it. I’ve tried to @EJB UserService userService and also @Inject…
-
3
votes1
answer212
viewsError au render screen in pimefaces application - Nullpointexception
Uu method, to be called gives NullPointException. Has an expression that validates when editing appears header "Product Editing", if New registration appears "new". No cadastroProdutoBean.java has…
-
3
votes1
answer542
viewsNo bean corresponds to CDI injection point
I’m looking to implement CDI. But when I use the @Inject annotation I’m notified with this warning "No bean corresponds to the injection point" Code line I’m notified of @Inject private…
-
3
votes1
answer333
viewsWeb Service Testing with Arquillian
I’m doing a unit test class and I’m using Arquillian because of CDI, in this case I’m testing a Web Service for authentication of company users. Follows the source of the test class:…
-
3
votes1
answer339
viewsShow data in a Datatable + JSF + Primefaces + CDI + Managedbean
Talk to me, people! I’m having a problem to popular a Datatable, I’m using Jsf, CDI. I believe that the name of teacher is coming normal because he is an object and the pupil is a List, But I don’t…
-
3
votes1
answer115
viewsProblems with Opensessioninviewer + JPA + Tomcat standard
Hello, I am using Tomcat + JPA + Vraptor 4 and I am using cdi to inject Entitymanager as follows. Entitymanagerfactorycreator: public class EntityManagerFactoryCreator { @ApplicationScoped @Produces…
-
3
votes1
answer282
viewsBetter definition of Entitymanager
I’m studying on JPA along with the Dependency Injection and read some points on the EntityManager: If we use the following method: public EntityManager getEntityManager() { EntityManagerFactory…
-
3
votes1
answer570
viewsServlet Container (Tomcat) or Application Server?
I am currently developing a project that uses JSF, JPA, CDI and EJB. I read in several places where they said that Tomcat (Servlet Container) does not have support for these technologies, but…
-
2
votes1
answer94
viewsNullpointerexception with CDI and JAX-RS
I’m studying JAX-RS and created a simple project with the following class: Webservice @Path("generic") public class GenericResource { @Inject private MeuServico servico; @GET @Produces("text/plain")…
-
2
votes1
answer108
viewsInter-yard injection
I have a Jar project, Helper, which has a process manager, where it controls the execution of etal threads. Where it receives an interface that performs the execution when triggered. I have another…
-
2
votes1
answer5323
viewsError "Transaction is required to perform this Operation" when inserting, editing, or deleting - Wildfly
So, guys, I’ve been racking my brain about this mistake for a while and I can’t figure out how to fix... The situation is this, I had this project running on Tomcat and now it was necessary to…
-
2
votes2
answers2116
viewsTomcat V8.5 not booting, error: Child container failed During start
I’m doing a college paper, a simple crud with JSF2, Hibernate, Primefaces and CDI. However at the moment I will initialize the project in Tomcat I have the following error: GRAVE: A child container…
-
2
votes1
answer286
viewsInstantiate annotated class with Hibernate inheritance using CDI
Good afternoon, I’m creating a project using JSF, CDI, Bootstrap and Hibernate. I would like to know how to work with the following problem, I have created a set of classes to represent a person…
-
2
votes1
answer529
views -
2
votes0
answers80
viewsCDI Beans inside . jar file are not found by container (Unsatisfied dependencies)
I created a Java project to lib other projects, decreasing code duplicity between projects. This lib project is exported to jar to be included in Web projects. In the Web projects (from which these…
-
2
votes1
answer300
viewsInject Dao into Converter
I’m having a java.lang.Nullpointerexception error in a Converter at the moment it will access the bank, apparently the dependency is not being injected by the CDI, there are arguments that the…
-
2
votes1
answer1016
viewsCDI Java - Configuration
I created a simple design containing a Test class and a Testeinterface interface. In the interface test I created any method just to test. In the Test class I only put @Inject Service service; When…
-
2
votes1
answer74
viewsComposite vs. Bean CDI - How to access bean methods
I am trying to create a component to receive the user profile picture. But for this I need to make the component access the methods within the CDI bean of the page in question. I’m doing something…
-
2
votes0
answers35
viewsCDI bean that goes up with the application
Is there any way to start a CDI bean next to the application I have the following bean: @ApplicationScoped @Named public class MyBean implements Serializable { @Inject private Helper helper;…
-
1
votes0
answers261
viewsREST + CDI (dependency error)
Hello, people, I come for some help, because it is my first contact with CDI and he does not find my resources. I will post the classes involving the Annotations, injects and console errors. I hope…
-
1
votes1
answer32
viewsExcess EJBS in Managedbean
Good morning, I have a question as to how the Container works in the injection of the EJBS will be that the quantity of EJBS injected in Managedbean can significantly interfere in the performance of…
-
1
votes0
answers89
viewsproblems with @Injection
Hi, guys. I’m creating a program that manipulates human and livestock records. In this program, on the livestock register screen, I am creating two Selectonemenu of the first faces. One is of type…
-
1
votes0
answers126
viewsSpring Security + CDI + Hibernatefilter
good afternoon! I am in a system with Primefaces, Hibernate, CDI and am implementing security with Spring-Security and control transactions with Hibernatefilter, declared on web.xml. I did all the…
-
1
votes0
answers84
viewsException interception for logging, using AOP with CDI in Java EE 7
Below I have part of a class, of which I want to eliminate repetitive logging code through AOP. /** * Javadoc omitido */ public abstract class JpaDao<T extends LongIdentifiable> implements…
-
1
votes1
answer90
viewsDoes not recognize my createQuery method
I am with a JSF2.2 project with CDI, and I have correctly configured my project for CDI, what is very strange is that the createQuery method is not being recognized, other times did the same way of…
-
1
votes1
answer191
viewsDoubts with Crud java CDI
I have connection with some database, with that, I made a class called connection, where I have verification of which database to use: package DAO; import CDI.Corporativo; import CDI.Java3DS; import…
-
1
votes2
answers755
viewsGeneric DAO with CDI error = cannot be cast to java.lang.reflect.Parameterizedtype
I’m trying to implement a generic CDI DAO. Apparently I’m doing it right, but I’m getting the following error: cannot be cast to java.lang.reflect.Parameterizedtype This error is pointing me to this…
-
1
votes1
answer165
viewsDoubt about JPQL
I honestly have a certain difficulty with comics, and I need a JPQL that returns only one record. I have a Price entity and a Product entity. I need to bring the last registered price by the user. I…
-
1
votes1
answer775
viewsProblems with Nullpointerexception in a JSF project
I am with an application that is displaying the following error message; jun 01, 2015 4:15:05 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute ADVERTÊNCIA: #{pesquisaPedidosBean.pesquisar}:…
-
1
votes1
answer297
viewsError when injecting object: returning null
When I inject an object into the class it returns null, it seems that it is not instantiated. Exception in thread "main" java.lang.NullPointerException at…
-
1
votes1
answer281
views@Inject for manually instantiated object?
I have a class called Application which is a listener, it instantiates objects of ServidorRadius where it needs to access the repositories that are injected with CDI, however radiusRepository is…
-
1
votes1
answer72
viewsHow to view Questions recovered from a DAO on the same JSF page
good afternoon. I have a page called simulated.xhtml in which I receive some parameters (Filter) to make a query in the database according to the filter. Everything is already working, what I wanted…
-
1
votes1
answer83
viewsDifficulty getting object inside a CDI Extension
I want to create an Extension in my project so that it starts to interpret an own annotation, for that I have initially a @Producer of the Quartz Scheduler object, see public class SchedulerProducer…
-
1
votes1
answer429
viewsInject CDI is not working with producer on a project . jar
I created an Entitymanager producer in a project .jar but the same does not work. I configured POM.XML with the dependency below <!-- CDI --> <dependency>…
-
1
votes1
answer463
viewsLifecycle of @Applicationscoped at Ear
I have an application with several WEB modules and an EJB inside an EAR as shown below: In the EJB module I created a class annotated with @ApplicationScoped, my goal is for this class to store…
-
1
votes1
answer95
viewsUsing CDI in the app
People have a problem , on my login screen I can inject the in a good, when I step to the second screen that would be the Dash , I can not inject , he only brings me with null .... Segue Conexao :…
-
1
votes1
answer746
viewsomnifaces does not recognize CDI configured in Tomcat
Good morning everyone. I’m doing the book project "algaworks-ebook-java-ee-7-com-jsf-primefaces-e-cdi-2a-edition-20150228" and I’m having trouble adding the omnifaces. When I go up the Tomcat, I get…
-
1
votes1
answer823
viewsWildfly 10 + Spring Security + JSF + CDI Does Not Inject Dependency
I’m trying to implement CDI in a WEB project I have where I use Wildfly10 with Spring Security (custom login) and JSF and I’m not being able to inject dependencies. In the Example below the User…
-
1
votes0
answers150
viewsBean CDI with @Sessionscoped initializes more than once
I created a bean CDI with session scope (@SessionScoped). The problem is that it is going through the constructor several times, and it should only be once while the user is logged in, correct? I’ve…
-
1
votes1
answer614
viewsJava project problems with CDI (Weld) + Hibernate + Primefaces
good night. I’m having trouble executing my project with the structure described in the title of this post. I am using Hibernate, with control of transactions by the server (JTA). Follows the…