webtier@glassfish.java.net

Can't get EntityManagerFactory when use hivemind inject Service class

From: <webtier_at_javadesktop.org>
Date: Tue, 10 Feb 2009 02:20:53 PST

I deploy Netbeans JsfJpaCrud to Glassfish V2.1, when I don't change anything, it's run OK!

But I want use Hivemind to manage Controller Service class, so I extract one interface for CustomerJpaController.java named CustomerJpaService.java, and I config it in hivemoudle.xml.

In CustomerController.java, I get the service instance class use java code:
jpaService = (CustomerJpaService) HiveMindFilter.getRegistry((HttpServletRequest) facesContext.getExternalContext().getRequest()).getService(CustomerJpaService.class);

When use this way to get the CustomerJpaController.java class, I can't get EntityManagerFactory EJB3 Inject with code:
@PersistenceUnit(unitName = "JsfJpaCrudPU")
private EntityManagerFactory emf = null;

When use the sample's way, I can get the EntityManagerFactory.

Why? and when the class inject EntityManagerFactory?

Someone can give some advices?
[Message sent by forum member 'i25ffz' (i25ffz)]

http://forums.java.net/jive/thread.jspa?messageID=330989