Referencing a CDI Bean in a non managed CDI Bean
问题 Is it possible to obtain an instance of a CDI bean inside a class that is created using the new keyword? We're currently making some enhancements on an old application, and we're always getting a ContextNotActiveException everytime we do a programmatic lookup on CDI Singleton beans in our app. Code for obtaining a reference: public class ClassCreatedWithNew{ public void doSomething(){ MySingletonBean myBean = BeanManagerSupport.getInstance().getBean(MySingletonBean.class); } }