File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to configure jboss for jms

 
djyoti sahu
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 367
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
djyoti sahu
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic