[jboss-user] [EJB 3.0] - How to access EntityManager in a Thread run() method?

jboss_raikankas do-not-reply at jboss.com
Fri Oct 3 01:53:52 EDT 2008


Hi,

I have got an Enterprise project with an EJB3, I am starting a Thread in a @Stateless bean but when I try to use my EJB3 EntityManager I get below exception. 

How can I access from inside the Thread to my EntityManager?

:01:35,812 ERROR [STDERR] Exception in thread "Thread-15"
20:01:35,812 ERROR [STDERR] java.lang.NullPointerException
20:01:35,812 ERROR [STDERR]     at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getNonTxEntityManager(ManagedEntityManagerFactory.java:59)
20:01:35,812 ERROR [STDERR]     at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getTransactionScopedEntityManager(ManagedEntityManagerFactory.java:164)
20:01:35,812 ERROR [STDERR]     at org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:132)
20:01:35,812 ERROR [STDERR]     at com.indra.localiza.ejb.modules.controlledtags.TagsControllerThread.run(TagsControllerThread.java:59)

Thanks in advance!

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4180202



More information about the jboss-user mailing list