Glassfish and java: comp / BeanManager

I have a .war application that I use for glass fish. I want to make a CDI, so I need to look for java: comp / BeanManager from my POJO. But this does not work: BeanManager just was not found!

What's wrong?

Do I need to include CDI in a glass fish? Or does it only work in .ear files?

thank.

+5
source share
1 answer

Do you have empty beans.xml in the WEB-INF folder? Without beans.xml, CDI is not included.

+6
source

All Articles