5 Replies Latest reply on Mar 29, 2005 11:59 AM by Bill Burke

    Newbie: EntityManagerHibernateSessionFactory not bound

    Pepe Mosca Newbie


      I am doing some tests with EJB3 and Jboss4.0.2RC1. I've installed all the stuff following the install instructions in EJB3_preview4.

      I've tried the Calculator example for the tutorial and all is ok. I've tried to inject an EntityManager in the CalculatorBean with the following statement:

      private EntityManager manager;

      and then a test method (also in the CalculatorBean) wich creates a query using an entity named 'BioUser' from another .ejb3:

      public int test() {
       return manager.createQuery("from BioUser").getResultList().size();

      I've tried from the calculator example client to add the method calculator.test()... and this is when the error is raised:

      Exception in thread "main" java.lang.RuntimeException: javax.naming.NameNotFoundException: EntityManagerHibernateSessionFactory not bound
       at org.jboss.ejb3.entity.EntityManagerImpl.getSession(EntityManagerImpl.java:143)
       at org.jboss.ejb3.entity.EntityManagerImpl.createQuery(EntityManagerImpl.java:39)
       at org.jboss.tutorial.stateless.bean.CalculatorBean.test(CalculatorBean.java:30)

      Thanks in anticipation!