[jboss-user] [JBoss Seam] - Re: EntityManager not being injected

c_eric_ray do-not-reply at jboss.com
Mon Aug 21 16:23:37 EDT 2006


Here's the code

jsf code...

  |         <h:selectOneMenu value="#{elem.code}" >
  |           <f:selectItems value="#{element.codeMap}" />
  |         </h:selectOneMenu>
  | 

Converter implementation


  |   @PersistenceContext(unitName="DC")
  |   EntityManager em;
  |   
  |   public Object getAsObject(FacesContext fContext, UIComponent component, String value) 
  |       throws ConverterException {
  |     CodeEntity ce = em.find(CodeEntity.class, value);
  |     return ce;
  |   }
  | 

em is always null. How can that be? This class is inside the container. Even if I make it a Session Bean is still doesn't work.

Need ideas. Thanks.


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

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



More information about the jboss-user mailing list