1 Reply Latest reply on Sep 28, 2006 3:58 PM by Mário Rodrigues

    EJb access - jndi works - injection doesn't know why not

    stephan opitz Newbie

      in jsf i want access to ejb

      public class DataFactory {

      @EJB
      private CategoriesLangFacade categoriesLangFacade;

      public CategoriesLangFacade getCategoriesLangFacade() {

      return categoriesLangFacade;
      }

      }

      solves categoriesLangFacade as null;

      without @EJB and jndi-lookup in the getCategoriesLangFacade it works
      under jboss 4.04ga - but why resource injection does not work ?

      ########################################

      public interface CategoriesLangFacade {

      public CategoriesLang findById(long categoriesLangId, long languageId);

      }

      #######################################

      @Local({CategoriesLangFacade.class})
      @Stateless
      public class CategoriesLangImp implements CategoriesLangFacade {

      @PersistenceContext(unitName = "ShaleTestPU")
      private EntityManager em;

      public static final String Remote = CategoriesLangImp.class
      .getSimpleName()
      + "/remote";

      public static final String Local = CategoriesLangImp.class
      .getSimpleName()
      + "/local";

      public CategoriesLang findById(long categoriesLangId, long languageId) {
      ...


      any solution or idea?