Currently ManagedBeans are injected via proxy that implements Managed Bean interfaces. But, Java EE 6 spec says that Managed Beans could be injected in 2 ways
1* Via interface 2* Via managed bean class In the second case, we get cast exception because OpenEJB always returns proxy that implements interfaces. So ,we have to manage this siutation also, ----- Original Message ---- From: David Blevins <[email protected]> To: [email protected] Sent: Sat, September 18, 2010 12:19:50 AM Subject: Re: Managed Bean Support On Sep 17, 2010, at 9:28 AM, Gurkan Erdogdu wrote: > Hi; > > I am looking the ManagedBean implementation. I think that currently it does > not > > support the injection of managed beans via @Resource? Is it correct or I am > wrong? I don't think that's in there yet, but referring to them via @EJB does work as a side affect of us treating @ManagedBean as a kind of session bean. Up for grabs if you want to work on it. Definitely feel encouraged to throw out implementation ideas before digging. I imagine that we'll not want a second copy of "resolve by interface" code and will want to somehow leverage the EjbResolver code we have. We could probably make it so you can refer to any EJB via @Resource to keep things consistent. Maybe we just detect that the @Resource ref is a bean ref and internally record it as a org.apache.openejb.jee.EjbLocalRef. -David
