the problem comes when I try to execute any of the entity manager methods, such as persist() or find(). It always throws a NullPointerException so I'd like to know where could be my problem. Any idea will help.
Thanks in advance
Do you run this application in an EJB container? @PersistenceContext can only be used if you use EJB. If you use pure JPA, you need to create the EntityManager by yourself, e.g.
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog