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

legae do-not-reply at jboss.com
Mon May 9 02:49:33 EDT 2011


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

"Re: Random NameNotFoundException in jboss 6.1-SNAPSHOT"

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

--------------------------------------------------------------
I think I found solution to my problem. 
When i removed from ZBean queue resource everything was ok. That's why I was trying to do sth with queue. 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(); 
    }
}
--------------------------------------------------------------

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

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/1f445172/attachment.html 


More information about the jboss-user mailing list