Thanks, it helped me a lot!
Now, I kinda understood how it's working, but my very last problem is pretty 
tough: I can't retrieve the EntityManager in my Session Bean extending 
ResourceBundle.

@Stateless
  | @Scope(SESSION)
  | @Name("dbResourceBundle")
  | public class DBResourceBundle extends ResourceBundle implements 
iDBResourceBundle{
  | 
  |     @PersistenceContext
  |     private EntityManager em;
  | 
  |     private List<CustomResourceBundle> availableResourceBundles;
  |     
  |     public DBResourceBundle(){
  |             System.out.println("EntityManager: "+em); //em is null :/
  |             try{
  |                     availableResourceBundles = em.createQuery("select rb 
from CustomResourceBundle rb").getResultList();
  |             }
  |             catch(Exception e){
  |                     //null pointer exception cause em is null.
  |                     e.printStackTrace();
  |                     
  |             }
  |     }
  | ...
  | 

CustomResourceBundle being an entity bean representing a 'bundle' for the given 
language.
How to retrieve a workable EntityManager?
My guess is that when this Session Bean is instanciated, the PersistenceContext 
isn't created yet.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059868
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to