I started playing with the EJB3 stuff. I downloaded JBoss 4.0.1sp1 and EJB3 Preview 5 and followed the installation instructions. Everything is working great for entity beans. I then took it the next step further and decided to have a SLSB. I put an @Inject EntityManager entityManager in as an instance variable on my SLSB. I wrote a simple client that looks up the SLSB and attempts to call some method on it. However, everytime the SLSB tries to use the entity manager the server throws this:
java.lang.RuntimeException: javax.naming.NameNotFoundException: EntityManagerHibernateSessionFactory not bound
17:58:11,762 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.getSession(EntityManagerImpl.java:220)
17:58:11,762 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.find(EntityManagerImpl.java:97)
So I thought maybe I'm not getting an entity manager injected at all, so I changed it to use setter style injectiont like this:
@Inject
public void setEntityManager(EntityManager manager)
{
System.out.println("-----------------------------------------");
System.out.println("manager = " + manager);
System.out.println("-----------------------------------------");
this.entityManager = manager;
}
The setter is getting called with a non-null entity manager (in fact its a org.jboss.ejb3.entity.EntityManagerImpl). But the first time any method tries to use the instance variable entityManager I get the same stack trace.
I saw on the forums people were having this problem when upgrading from preview 3 to preview 4. But I've never had either of those installed so I'm pretty sure EntityManager is in the "new" javax.persistence package.
Anyone have any ideas?
Thanks,
-jeff