Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish and java:comp/BeanManager

I have .war application that I deploy to glassfish. I want to do CDI, so I need to lookup java:comp/BeanManager from my POJO. But it does not work: BeanManager simply not found!

What is wrong?

Do I need to enable CDI in glassfish? Or it works only in .ear files?

thanks.

like image 724
Ilya K Avatar asked Feb 14 '11 11:02

Ilya K


1 Answers

Do you have an empty beans.xml under WEB-INF folder? Without beans.xml, CDI is not enabled.

like image 178
Otávio Garcia Avatar answered Nov 09 '22 17:11

Otávio Garcia