3 Replies Latest reply on Apr 24, 2006 3:21 AM by jjklappenbach

    Injecting an EJB from JSF Action

    hlfsousa

      Hi
      I have asked this around and found no response. I started EJB 3 recently, and I have successfully created and deployed my EJBs and Entitys. But when it comes to accessing them from a web tier things go wrong. I have an EJB that appears in JNDI like this: (my @Stateless annotation has no name attribute)

      +- WorldNet
       | +- PerfilServiceBean
       | | +- remote (proxy: $Proxy75 implements No ClassLoaders found for: com.diaup.worldnet.admin.PerfilService (no security manager: RMI class loader disabled))
      --------------
      @Stateless
      public class PerfilServiceBean implements PerfilService { ... }
      

      First of all, that "No ClassLoaders found" kind of scared me. Interface PerfilService is annotated as @Remote. Okay, my JSF Backing bean looks like this:
      public class BackingBean {
       @EJB
       private PerfilService ejb;
      
       public String doSomething() {
       ejb.doSomething();
       }
      }

      When doSomething() is called, ejb is null. I really don't know what happens. Both bean and interface classes are packaged in the same ejb jar. The BackingBean class is packaged in WEB-INF/classes of a war file, and both are contained in the same ear file. I guess that's why I don't get a ClassNotFoundException when BackingBean is loaded. Anyway, why ejb is still null?