I see that I cannot do a lookup of cdi BeanManager in wildfly 9.0.2. Here how I do the lookup and the injection in a simple servlet sample:
import javax.enterprise.inject.spi.BeanManager;
....
@Inject
private BeanManager beanManager;
......
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
InitialContext.doLookup("java:comp/BeanManager");
System.out.println(beanManager);
} catch (NamingException e) {
e.printStackTrace();
}
}
.....
Either the lookup or the injection no return results. Do I miss something?
problem resolved!
I missed an empty META-INF/beans.xml in the webapp