3 Replies Latest reply on Feb 3, 2007 11:31 AM by Alain Bergeron

    Can I use @EJB-style dependency injection in a Servlet withi

    None None Master

      I have been trying to get that to work, and I get nothing. I have a feeling that the dependency injector code needs to run on the Servlet object after it has been instantiated, and I have a feeling that Tomcat is not doing that. I saw on this page:

      http://www.netbeans.org/kb/articles/javaee5-hello-world.html

      Note: GlassFish already supports Servlet 2.5 and JSF 1.2 with Java EE 5 annotations for dependency injection in web tier. If you want to use JBoss you can test a standalone EJB module and use either J2SE client or use JNDI lookup to call the EJB.


      which suggests that I need to use JNDI within JBoss / Tomcat.

      Am I reading this correctly? I have tried everything to get @EJB working within my app and it just isn't working. Either I'm doing something wrong or it doesn't work.

      Thanks