[jboss-user] [EJB 3.0] - Resource injection into EJB gives "null" values in embeddabl

blazetrail do-not-reply at jboss.com
Tue Feb 20 03:33:55 EST 2007


Has anyone tried resource injection of EntityManager in EJB-3.0_Embeddable_ALPHA_9 ?

Injected value is null in embedded container, but same bean with persistence.xml in real JBoss 4.0.5GA injects correctly.

Trying to resource inject SessionContext also returns null.

I am using other injected resources like @EJB, deployment seems to understand, lookup and log these but I have not checked the values yet.

e.g
@Stateful
public class MyBean implements IMyBean {
  @PersistenceContext
  private EntityManager em;
  @Resource 
  protected SessionContext ctx;

public void someMethod() {  // em and ctx are null here
}

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

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



More information about the jboss-user mailing list