tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Bourque <christian.bour...@gmail.com>
Subject injection bug
Date Mon, 01 Feb 2010 22:23:27 GMT
Hi,

I have a weird problem with injection and I would like to confirm
whether or not it is a bug:

-----------------------------------------------------------------------------------------------------------------------------------
public abstract class A
{
  private EntityManager em;

  public EntityManager getEntityManager() { return em; }
  public void setEntityManager(EntityManager em) { this.em = em; }
}

@Stateless
public class B extends A implements IB
{
  @PersistenceContext
  private EntityManager em;

  @PostConstruct
  public void init()
  {
    System.out.println("*** Entity Manager: " + em);

    setEntityManager(em);
  }
}
-----------------------------------------------------------------------------------------------------------------------------------

In B the injected entity manager is always null! And If I simply
change the variable name to say "em2" then it works!

Tested on OpenEJB 3.1.2...

Thanks

Christian

Mime
View raw message