Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA - inject of EntityManager is always null

 
zshal shlev
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
serious beginner problem
i have an ejb3 in jboss 5.1
see code:

@Stateless(mappedName = "iknowbean")
public class IknowBean implements IknowBeanLocal {

@PersistenceContext (unitName="INOPro") private EntityManager emf;

in the persistence.xml i have the unitName appearing as the persistence-unit

why is emf always null

when i run it from servlet it works when i run it from this ejb it does not

any help would be great
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai...

May i know your persistence.xml configuration?...
and where do you put that persistence.xml file?..

Thanks ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic