I'm trying to run some unit tests using Embeddable EJB3 Container (Alpha 5). The basic tests work when I have one jar file that
contains both DAO and entity classes (persistence.xml in the META-INF directory). However when I separate the DAO (local stateless
session bean) into a separate jar, i.e. one jar for the DAO classes and another jar for the entity classes with the persistence.xml,
I got the javax.naming.NameNotFoundException from InitialContext lookup() of the sls bean:
InitialContext ctx = getInitialContext(); /* this method comes from the Alpha 5 tutorial */ MyEntityDAO dao = (MyEntityDAO) ctx .lookup("MyEntityDAOImpl/local");
Like many others.. I found an answer for my own posting : )
I was missing a persistence.xml in the dao jar.