-
1. Re: injecting a local EJB into a service POJO
jaikiran Mar 8, 2010 2:15 PM (in response to mhsheikh)1 of 1 people found this helpfulmhsheikh wrote:
I changed the @service annotation from org.jboss.annotation.ejb.Service; to org.jboss.ejb3.annotation.Service
All org.jboss.annotation.ejb.* annotations have been moved to org.jboss.ejb3.annotation.* in AS-5
mhsheikh wrote:
I tried using the @Depends annotation as follows
@Depends("jboss.j2ee:ear=xxxx,jar=yyy.jar,name=zzz,service=EJB3")
But it didn;t help.
Did you use org.jboss.ejb3.annotation.Depends? And is that the right ObjectName for the depends (you can check the jmx-console)?
-
2. Re: injecting a local EJB into a service POJO
mhsheikh Mar 8, 2010 3:22 PM (in response to jaikiran)UPDATE:
The @EJB annotation does work in JBoss 5.1
The reason that it didn't work in my case was a mistake on my part.
-
3. Re: injecting a local EJB into a service POJO
risrod Jul 28, 2010 6:41 AM (in response to mhsheikh)I post the solution that helped me (hope will help other people):
I moved the code that use the injected ejb from the create() lifecycle method to the start() lifecycle method, by this way the ejb is correct injected. Same concept for the destory() and the stop() method.