yunshi tan [
https://community.jboss.org/people/yunshi] created the discussion
"Re: @PersistenceContext is null in jboss7"
To view the discussion, visit:
https://community.jboss.org/message/759828#759828
--------------------------------------------------------------
Thanks Wolf-Dieter et Nicklas,
Finally find out the probleme. It has nothing to do with Ejb, neither Hibernate, but
classloading I think.
My probleme is
*I have a parent DAO which was placed in a module*
public abstract class ParentDAO{
@PersistenceContext
private EntityManager em;
// some basic functions...
}
*Then other DAO extends the parent DAO and they are placed in deployment*
@Stateless
public class DAO extends ParentDAO implements LocalDAO, RemoteDAO{
// other dao functions using em from parentDAO...
}
After I move the ParentDAO project out to deployment from the module, it works.
I cannot really figurer out why but I think its the classloading probleme.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/759828#759828]
Start a new discussion in JBoss AS 7 Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]