[jboss-user] [EJB3] - Re: Random NameNotFoundException in jboss 6.1-SNAPSHOT

jaikiran pai do-not-reply at jboss.com
Mon May 9 03:52:01 EDT 2011


jaikiran pai [http://community.jboss.org/people/jaikiran] created the discussion

"Re: Random NameNotFoundException in jboss 6.1-SNAPSHOT"

To view the discussion, visit: http://community.jboss.org/message/604109#604109

--------------------------------------------------------------
> legae wrote:
> 
> ...
> I added queue depends and somehow now the findAll method can be invoked and no excpetion is thrown. I'm not 100% sure whether it's the right solution but for me it worked
> @javax.ejb.Stateless
> *public* *class* ZBean  *implements* ZBeanLocal{
>  
>     @PersistenceContext(unitName = "TestPU")
>     *private* EntityManager em = *null*;
>  
>     @Resource(mappedName = "java:/JmsXA")
>     javax.jms.ConnectionFactory connFactory;
>     @Resource(mappedName = "queue/TestQueue")
>     @org.jboss.ejb3.annotation.Depends("org.hornetq:module=JMS,type=Queue,name=\"TestQueue\"")
>     javax.jms.Queue  q1;
>  
>  
>     *public* List<ZEntity> findAll(){        
>         Query q = em.createNamedQuery("findAll");
>         *return* (List<ZEntity>)q.getResultList(); 
>     }
> 
That's the correct solution.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/604109#604109]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110509/824c35ae/attachment-0001.html 


More information about the jboss-user mailing list