On Oct 22, 2010, at 8:44 AM, JF James wrote: > > I've done a (small) step further by comparing the CDI TestCases provided with > OpenEJB (SimpleCdiTest and CdiDecoratorTest) with my own TestCase. In these > two examples, the Managed Beans are explicitely configured in the setUp > method (by calling beans.addManagedClass) and everything is OK. > > In contrast, when starting "normally" OpenEJB by doing a JNDI lookup with a > LocalInitialContextFactory, no Managed Bean is configured. The > ReadDescriptors class takes into account the META-INF/beans.xml file and > configures CDI interceptors, delegators and alternatives in its readBeans > method. However, the addManagedClass method is never called (as far as I've > tested) during the OpenEJB startup and the list of Managed Beans remains > empty. > > That's why trying to inject a Managed Bean in a Session Bean results in an > error. > > I guess the expected behavior would be to treat implicitely every POJO class > (having an empty or injected constructor) from the EJB Module as a Managed > Bean. Am I wrong ?
I haven't figured out what ScannerService openejb is using with OWB, but the OWB scanners certainly do their best to find every class (no matter what the constructor is like). thanks david jencks > > I'm going to follow a little more my investigations ... > -- > View this message in context: > http://openejb.979440.n4.nabble.com/Using-OpenWebBeans-CDI-with-Junit-tp3000191p3007426.html > Sent from the OpenEJB Dev mailing list archive at Nabble.com.
