Not sure I get the question, but here is how we look up a queue from a session bean
that places a message on the queue.
InitialContext iniCtx = new InitialContext();
Object tmp = iniCtx.lookup("java:comp/env/jms/QueueConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
m_conn = qcf.createQueueConnection();
m_queue = (Queue) iniCtx.lookup( "java:comp/env/jms/EmSystemEmail");
m_session = m_conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
QueueSender send = m_session.createSender(m_queue);
ObjectMessage objectMsg = m_session.createObjectMessage(message);
send.send(objectMsg);
send.close();
With a bit of twiddling, you should be able to get it working for topics.
Here are the ejb-jar.xml and jboss.xml entries we use too:
<ejb-name>MailQueueSenderBean</ejb-name>
<local-home>com.exhibitormanual.ejb.mail.sender.MailQueueSenderLocalHome</local-home>
com.exhibitormanual.ejb.mail.sender.MailQueueSenderLocal
<ejb-class>com.exhibitormanual.ejb.mail.sender.MailQueueSenderBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-ref>
<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
<res-type>javax.jms.QueueConnectionFactory</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/EmSystemEmail</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
<ejb-name>MailQueueSenderBean</ejb-name>
<jndi-name>ejb/MailQueueSender</jndi-name>
<resource-ref>
<res-ref-name>jms/QueueConnectionFactory</res-ref-name>
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/EmSystemEmail</resource-env-ref-name>
<jndi-name>queue/EmSystemEmail</jndi-name>
</resource-env-ref>
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3823076#3823076
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3823076
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user