Ilya K
Ilya K

Reputation: 413

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.

Upvotes: 5

Views: 1665

Answers (1)

Otávio Garcia
Otávio Garcia

Reputation: 1372

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

Upvotes: 6

Related Questions