[jboss-user] [EJB 3.0] - NetBeans 5.5 + EJB3 + JBoss 4.2 == ejbLink: not used by any

LeandroSeverino do-not-reply at jboss.com
Mon Nov 5 08:10:30 EST 2007


Well,
   I'm sorry by my terrible english, because I'm writing from Brazil.
   I'll try explain my problem.

 My Environment:
   -> NetBeans 5.5.1
   -> JBoss 4.2.1 GA
   -> EJB 3 / JPA.

   I have a Enterprise Application (EAR) with 2 EJB modules + WAR module.

The projects:
 1) Report.ear (NetBeans EnterpriseApplication project.)
        1.1) Report-Business-ejb (NetBeans EJB Module project.)
            1.1.1) ElementoGerenciadoFacade (@Stateless, SessionBean EJB class.)
                 note : in this class I have a @EJB private DAOFactory daoFactory;
            1.1.2) ElementoGerenciadoFacadeLocal (@Local )
        1.2) Report-DAO-ejb (Netbeans EJB Module project)
        1.2.1) persistence.xml
        1.2.2) iDAO
        1.2.3) IElementoGerenciadoDAO
        1.2.4) ElementoGerenciadoDAOImpl
        1.2.5) DAOFactory ( como EJB @Stateless ) 
   1.3) Report-war.war 
      1.3.1) ListElementsServlet.

 The DAOFactory code


  | @Stateless
  | public class DAOFactory implements DAOFactoryLocal{
  |     
  |     /** Creates a new instance of DAOFactory */
  |     public DAOFactory() {
  |     }
  |     
  |     @PersistenceContext(unitName = "PU")
  |     private EntityManager entityManager;
  |     
  |     public ElementoGerenciadoDAOImpl getElementoGerenciadoDAO(){
  |         IDAO dao = new ElementoGerenciadoDAOImpl();
  |         dao.setEntityManager(entityManager);
  |         return (ElementoGerenciadoDAOImpl) dao;
  |     }
  |     
  | }
  | 

The ElementoGerenciadoFacade code


  | @Stateless
  | public class ElementoGerenciadoFacade implements ElementoGerenciadoFacadeLocal {
  |     @EJB
  |     private DAOFactory daoFactory;    
  |     
  |     public ElementoGerenciadoFacade() {
  |     }    
  |     public List findAll() {
  |         ElementoGerenciadoDAOImpl dao = daoFactory.getElementoGerenciadoDAO();
  |         return dao.findAll(); 
  |         //em.createQuery("select object(o) from ElementoGerenciado as o").getResultList();
  |     }
  |     
  | }
  | 

When I run, I receive this error message:
anonymous wrote : 
  |     Reason: java.lang.RuntimeException: could not resolve global JNDI name for @EJB for container ElementoGerenciadoFacade: reference class: com.digitel.ejb.DAOFactory ejbLink: not used by any EJBs
  | 

Well,
  I have a question:
   - I need configure some XML file / descriptor file ?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4101740#4101740

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4101740



More information about the jboss-user mailing list