The moose likes JBoss and the fly likes how to configure jboss  for jms Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "how to configure jboss  for jms" Watch "how to configure jboss  for jms" New topic
Author

how to configure jboss for jms

djyoti sahu
Greenhorn

Joined: Jan 28, 2003
Posts: 26
hi
all,
please tell me what are the files i have to configure for jms.
where will i mention jndi name of destination and connection factory.

with regards
jyoti
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 364
To configure a queue or a topic, create a service.xml file. (myqueue-service.xml, for example) There are some examples of how to do it in jbossmq-destinations-service.xml in your deploy directory. In fact, you could put your own definitions in that file, but I like to create my own service files for them.

Here is an example from the jboss distribution:

This queue's jndi name would be "queue/ex". You could look it up like that and use it directly (the connection factory is "ConnectionFactory") if you want. To link it to a MDB, add this in the enterprise beans section of your jboss.xml file:


It's pretty straightforward


[<a href="http://members.capmac.org/~orb/blog.cgi" target="_blank" rel="nofollow">blog</a>] [<a href="http://www.amazon.com/exec/obidos/ASIN/0596100078/orb-20" target="_blank" rel="nofollow">JBoss: A Developer's Notebook</a>] [<a href="http://www.amazon.com/exec/obidos/ASIN/1932394052/orb-20" target="_blank" rel="nofollow">XDoclet in Action</a>]
djyoti sahu
Greenhorn

Joined: Jan 28, 2003
Posts: 26
Hi
norman richards,

Thanks for suggestion.
i am getting some Exception during deployment.
I am using mysql as database.

my files are



<!--jboss.xml-->

<message-driven>
<ejb-name>SendMessageMDB</ejb-name>
<destination-jndi-name>queue/ex</destination-jndi-name>
</message-driven>
<!--ejb-jar.xml-->
<message-driven>
<ejb-name>SendMessageMDB</ejb-name>
<ejb-class>com.beo.atlas.beans2.sendmail.SendMessageMDB</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.queue</destination-type>
<subscription-durability></subscription-durability>
</message-driven-destination>
</message-driven>

<!-- client code -->
javax.naming.Context ctx = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("ConnectionFactory");
//create a connection
QueueConnection qConn = qcf.createQueueConnection();
//creater session
QueueSession qSession = qConn.createQueueSession(false,1);
//create a sender
Queue q = ( Queue ) ctx.lookup("queue/ex");
QueueSender sender = qSession.createSender(q);
//after message received from the quue the message will be removed from message queue
//QueueSender receiver = qSession.createReceiver(q);
//delivery message
TextMessage msg = qSession.createTextMessage();
msg.setText("i will set mesage here ");
sender.send(msg);

<!-- mdb code-->
i am getting exception at time of exception
javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound
at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:169)
at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:458)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:234)
at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)

with regards
jyoti
Uday Dattani
Greenhorn

Joined: Jun 03, 2004
Posts: 1
I was having the same problem. I had deleted the hsqldb-ds.xml file from my
deploy folder. I just learnt that this file which configures access to the hypersonic database is used by jboss to keep jms related data.

Just add the hsqldb-ds.xml file to your deploy folder and try reinstalling your application. This sholud work
 
 
subject: how to configure jboss for jms
 
Threads others viewed
Embedded JMS provider problem, Help!
Foreign JMS
JMS with JBOSS
WSAD5 + JMS support and external MQ
how to configure jms version 4.0 with tomcat4.0
jQuery in Action, 2nd edition

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture