to try out CDI with it. I also created a service, and tried to use @Inject through it, but the service is always null. Note that I already have defined beans.xml in my META-INF folder. Can anyone help me understand where I am going wrong with it?
Do I need weld as well?
I gave up. Rather would use Spring boot
Use bean-discovery-mode="ALL" or bean-discovery-mode="ANNOTATED" in the beans.xml (assuming you're using CDI 1.1 or later. For CDI versions less than 1.1, beans.xml configuration is mandatory. Ref: https://docs.jboss.org/cdi/spec/1.1/cdi-spec.html https://stackoverflow.com/questions/18310388/meaning-of-bean-discovery-mode-annotated-in-cdi-1-1 Even if you use spring, you have to explicitly ask it to use annotation configuration, right (@Configuration).
I had already used discovery mode as "all"
Обсуждают сегодня