0 Replies Latest reply on Jul 17, 2006 2:03 PM by Ângelo Luis

    Lookup work, but @EJB annotation don't

    Ângelo Luis Newbie

      I have this in my JSF backing bean:

      private CadastroManagerLocal getCadastroManagerLocal(){
      try {
      Properties p = new Properties();
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

      InitialContext ctx = new InitialContext(p);
      Object ref = ctx.lookup("CadastroManagerBean");
      return (CadastroManagerLocal) PortableRemoteObject.narrow(ref, CadastroManagerLocal.class);
      } catch (Exception e) {
      return null;

      and work fine, but when a try to inject with @EJB annotation i have nothing...

      private CadastroManagerLocal cadastroManagerLocal;


      private CadastroManagerLocal cadastroManagerLocal;

      I see in the documentation that the EJB work only in "java:com/env" ENC and my Bean is in global jndi namespace...

      This is the problem? how do i change from global to java:comp/env?:??