1 of 1 people found this helpful
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
I tried using the @Depends annotation as follows
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)?
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.
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.